summaryrefslogtreecommitdiff
path: root/save.c
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2022-08-14 10:10:23 -0700
committerAlan Coopersmith <alan.coopersmith@oracle.com>2022-08-14 10:10:23 -0700
commit88262a274bdd850e14cc27dd3d421182bbc157d5 (patch)
tree561f0d6c803cf1ea57c542ffe57e3fe70ba573a1 /save.c
parent0c55e2eabe6755b88de9835da8185a52b7712847 (diff)
Use calloc instead of malloc to allocate arrays
Most important in ReadProxyFileEntry, if we goto give_up before we finish initializing the array, makes sure we don't try to free uninitialized pointers during cleanup pass. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Diffstat (limited to 'save.c')
-rw-r--r--save.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/save.c b/save.c
index 738ada9..db5ca1e 100644
--- a/save.c
+++ b/save.c
@@ -263,7 +263,7 @@ ReadProxyFileEntry(FILE *proxyFile, ProxyFileEntry **pentry)
entry->wm_command = NULL;
else
{
- entry->wm_command = malloc (entry->wm_command_count * sizeof (char *));
+ entry->wm_command = calloc (entry->wm_command_count, sizeof (char *));
if (!entry->wm_command)
goto give_up;