summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--cgit.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/cgit.c b/cgit.c
index f4dd6ef..e302a7c 100644
--- a/cgit.c
+++ b/cgit.c
@@ -31,2 +31,3 @@ struct cgit_filter *new_filter(const char *cmd, int extra_args)
struct cgit_filter *f;
+ int args_size = 0;
@@ -37,5 +38,6 @@ struct cgit_filter *new_filter(const char *cmd, int extra_args)
f->cmd = xstrdup(cmd);
- f->argv = xmalloc((2 + extra_args) * sizeof(char *));
+ args_size = (2 + extra_args) * sizeof(char *);
+ f->argv = xmalloc(args_size);
+ memset(f->argv, 0, args_size);
f->argv[0] = f->cmd;
- f->argv[1] = NULL;
return f;