]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Resolve a resource leak in test_util_split_lines
authorNick Mathewson <nickm@torproject.org>
Wed, 30 Nov 2011 17:16:08 +0000 (12:16 -0500)
committerNick Mathewson <nickm@torproject.org>
Wed, 30 Nov 2011 17:16:08 +0000 (12:16 -0500)
Fixes coverity CID # 488

src/test/test_util.c

index 93f11cd208029242f92180c08d97359d3da688a1..c762a8d7b30b839d1c36b54548aa1c342ecd2cbd 100644 (file)
@@ -1660,7 +1660,7 @@ test_util_split_lines(void *ptr)
 
   int i, j;
   char *orig_line;
-  smartlist_t *sl;
+  smartlist_t *sl=NULL;
 
   (void)ptr;
 
@@ -1689,10 +1689,12 @@ test_util_split_lines(void *ptr)
     tt_assert(tests[i].split_line[j] == NULL);
     tor_free(orig_line);
     smartlist_free(sl);
+    sl = NULL;
   }
 
  done:
-  ;
+  tor_free(orig_line);
+  smartlist_free(sl);
 }
 
 static void