[patch] fix invalid free() in HEAD's readlink.c

Bernhard Fischer rep.nop at aon.at
Sun Sep 11 09:02:08 UTC 2005


Hi,

Sorry, i overread that bug yesterday.

http://busybox.net/cgi-bin/viewcvs.cgi?rev=9542&view=rev
introduced RESERVE_CONFIG_BUFFER but forgot to use the proper cleanup
in the exit path.

This fixes the invalid free() call.

please apply (the stable branch doesn't seem to be affected),
Bernhard
-------------- next part --------------
--- busybox.oorig/debianutils/readlink.c	2005-09-11 10:08:49.000000000 +0200
+++ busybox/debianutils/readlink.c	2005-09-11 10:48:52.000000000 +0200
@@ -57,7 +57,7 @@ int readlink_main(int argc, char **argv)
 		return EXIT_FAILURE;
 	puts(buf);
 
-	if (ENABLE_FEATURE_CLEAN_UP) free(buf);
+	if (ENABLE_FEATURE_CLEAN_UP) RELEASE_CONFIG_BUFFER(buf);
 
 	return EXIT_SUCCESS;
 }


More information about the busybox mailing list