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

Tom Tromey
2014-06-24T13:44:39Z

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