This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH v2 1/3] make_corefile_notes: have caller free returned memory


>>>>> "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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]