This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH v2 1/3] make_corefile_notes: have caller free returned memory
- From: Tom Tromey <tromey at redhat dot com>
- To: Markus Metzger <markus dot t dot metzger at intel dot com>
- Cc: palves at redhat dot com, gdb-patches at sourceware dot org
- Date: Tue, 24 Jun 2014 07:44:34 -0600
- Subject: Re: [PATCH v2 1/3] make_corefile_notes: have caller free returned memory
- Authentication-results: sourceware.org; auth=none
- References: <1403599872-25299-1-git-send-email-markus dot t dot metzger at intel dot com>
>>>>> "Markus" == Markus Metzger <markus.t.metzger@intel.com> writes:
Markus> if (note_data == NULL || note_size == 0)
Markus> error (_("Target does not support core file generation."));
Markus> + cleanup = make_cleanup (xfree, note_data);
I wonder if it is possible for note_data!=NULL but note_size==0.
If it is possible, then the cleanup ought to be moved earlier.
(FWIW it's ok to have an xfree cleanup with a NULL argument.)
Or if it is not possible, then I suppose the code just above is in
error... not your problem but if you happen to know, I would like to fix
it up.
thanks,
Tom