diff options
author | Lukas Fleischer <cgit@cryptocrack.de> | 2013-04-06 13:30:54 +0200 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2013-04-08 15:45:34 +0200 |
commit | 3edfd83db61f5dd2f046e6e8c21dfceeae03ed82 (patch) | |
tree | b29785135661b5f7bbb314b521b36351e021f142 | |
parent | 8f208794318f83826e98168b8b430f2d9a68bcce (diff) | |
download | cgit-3edfd83db61f5dd2f046e6e8c21dfceeae03ed82.tar.gz cgit-3edfd83db61f5dd2f046e6e8c21dfceeae03ed82.tar.xz |
html.c: Replace strdup() with xstrdup()
Use the xstrdup() wrapper which already bails out if strdup() returns a
NULL pointer.
Signed-off-by: Lukas Fleischer <cgit@cryptocrack.de>
-rw-r--r-- | html.c | 7 |
1 files changed, 2 insertions, 5 deletions
@@ -6,6 +6,7 @@ * (see COPYING for full license text) */ +#include "cgit.h" #include "html.h" #include <unistd.h> #include <stdio.h> @@ -307,11 +308,7 @@ int http_parse_querystring(const char *txt_, void (*fn)(const char *name, const if (!txt_) return 0; - o = t = txt = strdup(txt_); - if (t == NULL) { - printf("Out of memory\n"); - exit(1); - } + o = t = txt = xstrdup(txt_); while ((c=*t) != '\0') { if (c == '=') { *t = '\0'; |