On Fri, 30 Jul 2010, Jay Foad wrote: > > + /* Attempt to free the storage associated with the local symbols > > + that we threw away. Whether or not this has any effect on the > > + memory allocation depends on the malloc implementation and how > > + many symbols we managed to discard. */ > > syms = realloc(syms, nsyms * sizeof(*syms)); > > + if (syms == NULL) { > > + free(s); > > + free(strings); > > + return; > > + } > > If realloc() fails it leaves the original object unchanged, so can't > you just write:
Life is not as simple as one would like it to be. http://www.mail-archive.com/qemu-devel@nongnu.org/msg22137.html > > t = realloc(syms, nsyms * sizeof(*syms)); > if (t != NULL) { > syms = t; > } > > ? > > Jay. > -- mailto:av1...@comtv.ru