From: Lukas Fleischer Date: Sat, 6 Apr 2013 11:30:54 +0000 (+0200) Subject: html.c: Replace strdup() with xstrdup() X-Git-Tag: v0.9.2~50 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3edfd83db61f5dd2f046e6e8c21dfceeae03ed82;p=cgit 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 --- diff --git a/html.c b/html.c index 1104f97..8c45ba6 100644 --- a/html.c +++ b/html.c @@ -6,6 +6,7 @@ * (see COPYING for full license text) */ +#include "cgit.h" #include "html.h" #include #include @@ -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';