summaryrefslogtreecommitdiffstats
path: root/client
diff options
context:
space:
mode:
authorBrian Cully <bjc@kublai.com>2010-04-06 10:18:37 -0400
committerBrian Cully <github.20.shmit@spamgourmet.com>2010-04-06 10:18:37 -0400
commit03996f23159710c58ac2131034303412af64ed6b (patch)
tree0b514a3b58cb40415b23612047c30e7a86cd7225 /client
parent3d0382d6c525a5457a677464c6ad3561ee372cea (diff)
downloadnastd-03996f23159710c58ac2131034303412af64ed6b.tar.gz
nastd-03996f23159710c58ac2131034303412af64ed6b.zip
client/nastapi: Fix memory check when allocating string storage.
Diffstat (limited to 'client')
-rw-r--r--client/nastapi.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/client/nastapi.c b/client/nastapi.c
index b6c14f0..82bdaee 100644
--- a/client/nastapi.c
+++ b/client/nastapi.c
@@ -35,8 +35,10 @@ nast_string_new(int slen, const char *data)
return NULL;
tmp->strdata = malloc((slen+1) * sizeof(char *));
- if (tmp == NULL)
+ if (tmp->strdata == NULL) {
+ free(tmp);
return NULL;
+ }
memcpy(tmp->strdata, data, slen);
tmp->strdata[slen] = '\0';
tmp->strlen = slen;