This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc 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] Fix another unbound alloca (BZ 13761)


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


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