Displaying 2 results from an estimated 2 matches for "7571f95".
Did you mean:
757195
2009 Sep 11
2
[PATCH] generator.ml: Fix string list memory leak
Parsed string lists are allocated by malloc, but were never freed.
---
src/generator.ml | 16 +++++++++++++++-
1 files changed, 15 insertions(+), 1 deletions(-)
diff --git a/src/generator.ml b/src/generator.ml
index 7571f95..c72c329 100755
--- a/src/generator.ml
+++ b/src/generator.ml
@@ -6320,7 +6320,7 @@ and generate_fish_cmds () =
| OptString n
| FileIn n
| FileOut n -> pr " const char *%s;\n" n
- | StringList n | DeviceList n -> pr " char *const *%s;\n"...
2009 Sep 11
1
[FOR REVIEW ONLY] guestfish: Enable grouping in string lists
...gv) * argv_i + 1);
+ argv[argv_i] = tok;
+ argv_i++;
+ }
}
- argv[i] = NULL;
+
+ /* NULL terminate the argument list */
+ argv = realloc(argv, sizeof(*argv) * argv_i + 1);
+ argv[argv_i] = NULL;
return argv;
}
diff --git a/src/generator.ml b/src/generator.ml
index 5cf6a94..7571f95 100755
--- a/src/generator.ml
+++ b/src/generator.ml
@@ -6348,7 +6348,8 @@ and generate_fish_cmds () =
pr " %s = strcmp (argv[%d], \"-\") != 0 ? argv[%d] : \"/dev/stdout\";\n"
name i i
| StringList name | DeviceList name ->...