diff options
author | Christian Grothoff <christian@grothoff.org> | 2011-01-14 18:21:17 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2011-01-14 18:21:17 +0000 |
commit | 39b6c2e1c5b8a0dea9c9c1df0f9bab8e71b1353b (patch) | |
tree | 89709eeeaf709fbe4b97be978efd25932965f1cf | |
parent | 1bc35ab9741ab65104ae15cbed0f7587b549d09c (diff) | |
download | libmicrohttpd-39b6c2e1c5b8a0dea9c9c1df0f9bab8e71b1353b.tar.gz libmicrohttpd-39b6c2e1c5b8a0dea9c9c1df0f9bab8e71b1353b.zip |
nullcheck
-rw-r--r-- | src/daemon/base64.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/daemon/base64.c b/src/daemon/base64.c index 8ea73006..d99209e2 100644 --- a/src/daemon/base64.c +++ b/src/daemon/base64.c | |||
@@ -68,8 +68,9 @@ char* BASE64Decode(const char* src) { | |||
68 | /* Wrong base64 string length */ | 68 | /* Wrong base64 string length */ |
69 | return NULL; | 69 | return NULL; |
70 | } | 70 | } |
71 | result = dest = (char*) malloc(in_len / 4 * 3 + 1); | 71 | result = dest = malloc(in_len / 4 * 3 + 1); |
72 | 72 | if (result == NULL) | |
73 | return NULL; /* out of memory */ | ||
73 | while (*src) { | 74 | while (*src) { |
74 | char a = base64_digits[(unsigned char)*(src++)]; | 75 | char a = base64_digits[(unsigned char)*(src++)]; |
75 | char b = base64_digits[(unsigned char)*(src++)]; | 76 | char b = base64_digits[(unsigned char)*(src++)]; |