diff options
author | beck <> | 2014-07-13 16:03:10 +0000 |
---|---|---|
committer | beck <> | 2014-07-13 16:03:10 +0000 |
commit | 6e4dfa23733fddf37830d1039cf31a2ffb86bdaf (patch) | |
tree | c2bbb8405534dcf838bc686b6748045284f3966b /src/lib/libcrypto/ocsp | |
parent | 143b41eb184dd7da7b6f74162483016fbb5faab0 (diff) | |
download | openbsd-6e4dfa23733fddf37830d1039cf31a2ffb86bdaf.tar.gz openbsd-6e4dfa23733fddf37830d1039cf31a2ffb86bdaf.tar.bz2 openbsd-6e4dfa23733fddf37830d1039cf31a2ffb86bdaf.zip |
The bell tolls for BUF_strdup - Start the migration to using
intrinsics. This is the easy ones, a few left to check one at
a time.
ok miod@ deraadt@
Diffstat (limited to 'src/lib/libcrypto/ocsp')
-rw-r--r-- | src/lib/libcrypto/ocsp/ocsp_lib.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/lib/libcrypto/ocsp/ocsp_lib.c b/src/lib/libcrypto/ocsp/ocsp_lib.c index 8599e48bff..51d2c719f2 100644 --- a/src/lib/libcrypto/ocsp/ocsp_lib.c +++ b/src/lib/libcrypto/ocsp/ocsp_lib.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ocsp_lib.c,v 1.14 2014/07/11 08:44:49 jsing Exp $ */ | 1 | /* $OpenBSD: ocsp_lib.c,v 1.15 2014/07/13 16:03:09 beck Exp $ */ |
2 | /* Written by Tom Titchener <Tom_Titchener@groove.net> for the OpenSSL | 2 | /* Written by Tom Titchener <Tom_Titchener@groove.net> for the OpenSSL |
3 | * project. */ | 3 | * project. */ |
4 | 4 | ||
@@ -191,7 +191,7 @@ OCSP_parse_url(char *url, char **phost, char **pport, char **ppath, int *pssl) | |||
191 | *ppath = NULL; | 191 | *ppath = NULL; |
192 | 192 | ||
193 | /* dup the buffer since we are going to mess with it */ | 193 | /* dup the buffer since we are going to mess with it */ |
194 | buf = BUF_strdup(url); | 194 | buf = url ? strdup(url) : NULL; |
195 | if (!buf) | 195 | if (!buf) |
196 | goto mem_err; | 196 | goto mem_err; |
197 | 197 | ||
@@ -222,9 +222,9 @@ OCSP_parse_url(char *url, char **phost, char **pport, char **ppath, int *pssl) | |||
222 | /* Check for trailing part of path */ | 222 | /* Check for trailing part of path */ |
223 | p = strchr(p, '/'); | 223 | p = strchr(p, '/'); |
224 | if (!p) | 224 | if (!p) |
225 | *ppath = BUF_strdup("/"); | 225 | *ppath = strdup("/"); |
226 | else { | 226 | else { |
227 | *ppath = BUF_strdup(p); | 227 | *ppath = strdup(p); |
228 | /* Set start of path to 0 so hostname is valid */ | 228 | /* Set start of path to 0 so hostname is valid */ |
229 | *p = '\0'; | 229 | *p = '\0'; |
230 | } | 230 | } |
@@ -244,11 +244,11 @@ OCSP_parse_url(char *url, char **phost, char **pport, char **ppath, int *pssl) | |||
244 | port = "80"; | 244 | port = "80"; |
245 | } | 245 | } |
246 | 246 | ||
247 | *pport = BUF_strdup(port); | 247 | *pport = strdup(port); |
248 | if (!*pport) | 248 | if (!*pport) |
249 | goto mem_err; | 249 | goto mem_err; |
250 | 250 | ||
251 | *phost = BUF_strdup(host); | 251 | *phost = strdup(host); |
252 | 252 | ||
253 | if (!*phost) | 253 | if (!*phost) |
254 | goto mem_err; | 254 | goto mem_err; |