malloc() with out free() in popt (2.4.7pre)

John E. Malmberg malmberg at
Tue Aug 14 00:38:23 EST 2001

I am still chasing this down, but in doing the build for OpenVMS,

I have discovered that one of the popt modules is using HAVE_ALLOCA_H
to determine if the alloca function is on a platform.

That is not a good assumption.  Compaq C does have an alloca() built in
(slightly different symbol name, I assume because of symbol naming rules
in the C standard.)

Because alloca is a non-standard extension, if present it may not be in
an alloca.h header, it could be in a different header.

HAVE_ALLOCA_H should only decide if the code should #include <alloca.h>.

HAVE_ALLOCA should decide if the alloca built-in equivalent function 
should be used.

The more serious apparent bug, is that malloc() is being substituted for
alloca() in the case that alloca.h is not present.

No free() call seems to be done.

Therefore the memory malloc() is lost until the program exits.

wb8tyw at
Personal Opinion Only

More information about the rsync mailing list