Browse Source

Fix memory leak in unittest helper function.

Nick Mathewson 10 years ago
parent
commit
1117889f4a
1 changed files with 2 additions and 0 deletions
  1. 2 0
      src/test/test_util.c

+ 2 - 0
src/test/test_util.c

@@ -3146,6 +3146,8 @@ smartlist_new_from_text_lines(const char *lines)
   last_line = smartlist_pop_last(sl);
   if (last_line != NULL && *last_line != '\0') {
     smartlist_add(sl, last_line);
+  } else {
+    tor_free(last_line);
   }
 
   return sl;