Whamcloud - gitweb
ChangeLog, execute_cmd.c:
authorTheodore Ts'o <tytso@mit.edu>
Tue, 18 Jan 2000 16:24:13 +0000 (16:24 +0000)
committerTheodore Ts'o <tytso@mit.edu>
Tue, 18 Jan 2000 16:24:13 +0000 (16:24 +0000)
  execute_cmd.c (ss_execute_line): Fix memory leak; we weren't freeing
   the argv array.

lib/ss/ChangeLog
lib/ss/execute_cmd.c

index b619e51..b587bb5 100644 (file)
@@ -1,5 +1,8 @@
 1999-11-19    <tytso@valinux.com>
 
+       * execute_cmd.c (ss_execute_line): Fix memory leak; we weren't
+               freeing the argv array.
+
        * Makefile.in (distclean): Remove TAGS and Makefile.in.old from
                the source directory.
 
index 3641d0f..fbae177 100644 (file)
@@ -196,7 +196,7 @@ int ss_execute_line (sci_idx, line_ptr)
     char *line_ptr;
 {
     char **argv;
-    int argc;
+    int argc, ret;
 
     /* flush leading whitespace */
     while (line_ptr[0] == ' ' || line_ptr[0] == '\t')
@@ -219,5 +219,9 @@ int ss_execute_line (sci_idx, line_ptr)
         return 0;
 
     /* look it up in the request tables, execute if found */
-    return really_execute_command (sci_idx, argc, &argv);
+    ret = really_execute_command (sci_idx, argc, &argv);
+
+    free(argv);
+
+    return(ret);
 }