do not download kernel sources when using an external kernel tree
[librecmc/librecmc.git] / package / busybox / patches / 430-uniq_memleak.patch
index d43806f518866cea9fc9c87d70bd55cfe223c4eb..93f60eb004ed77c6918708667729c58eb967c516 100644 (file)
@@ -1,13 +1,11 @@
-Index: busybox-1.4.2/coreutils/uniq.c
-===================================================================
---- busybox-1.4.2.orig/coreutils/uniq.c        2007-06-04 13:21:31.993112976 +0200
-+++ busybox-1.4.2/coreutils/uniq.c     2007-06-04 13:21:35.960509840 +0200
-@@ -83,6 +83,8 @@
+--- a/coreutils/uniq.c
++++ b/coreutils/uniq.c
+@@ -82,6 +82,8 @@ int uniq_main(int argc UNUSED_PARAM, cha
  
-                       if (!s0 || strcmp(e0, e1)) {
+                       if (!s0 || strncmp(e0, e1, max_chars)) {
                                break;
 +                      } else {
 +                              free(s1);
                        }
  
-                       ++dups;          /* Note: Testing for overflow seems excessive. */
+                       free((char*)s1);