diff options
author | Tiago Cunha <tcunha@gmx.com> | 2009-08-26 22:13:52 +0000 |
---|---|---|
committer | Tiago Cunha <tcunha@gmx.com> | 2009-08-26 22:13:52 +0000 |
commit | d15e88cb688fa1d799920e35f0676fdcb3995a79 (patch) | |
tree | 4b9fdbefc8c85934fd4e2307a2a403b2e41726fc | |
parent | 83e44c7d8e6e7d686c9738fa432bb811e9ac74c4 (diff) |
Sync OpenBSD patchset 299:
Initialise the arg2 pointer properly (also free it when freeing the
others). Fixes crashes with J in malloc_options reported by oga.
-rw-r--r-- | cmd-generic.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/cmd-generic.c b/cmd-generic.c index 59bd7117..df9aeb16 100644 --- a/cmd-generic.c +++ b/cmd-generic.c @@ -1,4 +1,4 @@ -/* $Id: cmd-generic.c,v 1.33 2009-08-11 14:42:59 nicm Exp $ */ +/* $Id: cmd-generic.c,v 1.34 2009-08-26 22:13:52 tcunha Exp $ */ /* * Copyright (c) 2008 Nicholas Marriott <nicm@users.sourceforge.net> @@ -155,6 +155,7 @@ cmd_target_init(struct cmd *self, unused int key) data->chflags = 0; data->target = NULL; data->arg = NULL; + data->arg2 = NULL; } int @@ -204,6 +205,8 @@ cmd_target_free(struct cmd *self) xfree(data->target); if (data->arg != NULL) xfree(data->arg); + if (data->arg2 != NULL) + xfree(data->arg2); xfree(data); } @@ -236,6 +239,7 @@ cmd_srcdst_init(struct cmd *self, unused int key) data->src = NULL; data->dst = NULL; data->arg = NULL; + data->arg2 = NULL; } int @@ -290,6 +294,8 @@ cmd_srcdst_free(struct cmd *self) xfree(data->dst); if (data->arg != NULL) xfree(data->arg); + if (data->arg2 != NULL) + xfree(data->arg2); xfree(data); } @@ -324,6 +330,7 @@ cmd_buffer_init(struct cmd *self, unused int key) data->target = NULL; data->buffer = -1; data->arg = NULL; + data->arg2 = NULL; } int @@ -384,6 +391,8 @@ cmd_buffer_free(struct cmd *self) xfree(data->target); if (data->arg != NULL) xfree(data->arg); + if (data->arg2 != NULL) + xfree(data->arg2); xfree(data); } |