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 eceff6d4b17bff0faa77d5958c104a5724800663..be53b312e2186197edbedb65d39c2cf3c2489af6 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 */
                }