Code

sysdb: Free memory allocated by readline().
authorSebastian Harl <sh@tokkee.org>
Fri, 13 Dec 2013 13:36:38 +0000 (14:36 +0100)
committerSebastian Harl <sh@tokkee.org>
Fri, 13 Dec 2013 13:36:38 +0000 (14:36 +0100)
src/client/sysdb.c

index 66790cd29872a2db358f7d41605a9df707e3e0d2..aa791385cba8fabcb92b4a8810e91820f26b12a5 100644 (file)
@@ -240,11 +240,15 @@ main(int argc, char **argv)
 
                if (! line)
                        break;
-               if (*line == '\0')
+               if (*line == '\0') {
+                       free(line);
                        continue;
+               }
 
                if (*line != ' ')
                        add_history(line);
+
+               free(line);
        }
 
        if (hist_file[0] != '\0') {