[Patch] Fix another unbound alloca (BZ 13761)

Roland McGrath roland@hack.frob.com
Fri Jun 22 22:15:00 GMT 2012


You've added a "free (dataset);" call, but DATASET is never malloc'd.
If it's not alloca'd, it's from mempool_alloc.

I don't understand the nscd code well enough off hand to be sure it's
appropriate to use mempool_alloc for whatever the "(he != NULL)" case
means.  If it is, then you don't need to free it because those pools are
GC'd--so you need less change than you did, the 'alloca_used' variable is
fine as it was.  If it's not, then you need to use malloc for the new third
case (he != NULL && !__libc_use_alloca (...)), handle that error case
somehow, and do yet more bookkeeping to free it only when you used malloc.


Thanks,
Roland



More information about the Libc-alpha mailing list