summaryrefslogtreecommitdiff
path: root/apps/apps.c
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2014-06-27 03:21:10 +0100
committerJanusz Kozerski <j.kozerski@samsung.com>2014-10-20 15:25:27 +0200
commitf6c4120641ebfbfaf1cda389cc2b88ee072ab387 (patch)
tree310ba2fabea452b42d3434a1f5b80608b043a0de /apps/apps.c
parent5d085e18856f23c8e6f37602e132b4193de697e3 (diff)
downloadopenssl-f6c4120641ebfbfaf1cda389cc2b88ee072ab387.tar.gz
openssl-f6c4120641ebfbfaf1cda389cc2b88ee072ab387.tar.bz2
openssl-f6c4120641ebfbfaf1cda389cc2b88ee072ab387.zip
Memory leak and NULL derefernce fixes.
PR#3403
Diffstat (limited to 'apps/apps.c')
-rw-r--r--apps/apps.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/apps/apps.c b/apps/apps.c
index b76db10..3e18289 100644
--- a/apps/apps.c
+++ b/apps/apps.c
@@ -390,6 +390,8 @@ int chopup_args(ARGS *arg, char *buf, int *argc, char **argv[])
{
arg->count=20;
arg->data=(char **)OPENSSL_malloc(sizeof(char *)*arg->count);
+ if (arg->data == NULL)
+ return 0;
}
for (i=0; i<arg->count; i++)
arg->data[i]=NULL;
@@ -1542,6 +1544,8 @@ char *make_config_name()
len=strlen(t)+strlen(OPENSSL_CONF)+2;
p=OPENSSL_malloc(len);
+ if (p == NULL)
+ return NULL;
BUF_strlcpy(p,t,len);
#ifndef OPENSSL_SYS_VMS
BUF_strlcat(p,"/",len);