diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2022-08-14 10:10:23 -0700 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2022-08-14 10:10:23 -0700 |
commit | 88262a274bdd850e14cc27dd3d421182bbc157d5 (patch) | |
tree | 561f0d6c803cf1ea57c542ffe57e3fe70ba573a1 /save.c | |
parent | 0c55e2eabe6755b88de9835da8185a52b7712847 (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.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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; |