uniq: plug memory leak (patch from OpenWRT project)
authorDenys Vlasenko <vda.linux@googlemail.com>
Sun, 30 Aug 2009 17:34:09 +0000 (19:34 +0200)
committerDenys Vlasenko <vda.linux@googlemail.com>
Sun, 30 Aug 2009 17:34:09 +0000 (19:34 +0200)
function                                             old     new   delta
uniq_main                                            371     389     +18

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
coreutils/uniq.c

index eceff6d..be53b31 100644 (file)
@@ -89,6 +89,7 @@ int uniq_main(int argc UNUSED_PARAM, char **argv)
                                break;
                        }
 
+                       free(cur_line);
                        ++dups;  /* testing for overflow seems excessive */
                }