From mboxrd@z Thu Jan 1 00:00:00 1970 From: cgit at cryptocrack.de (Lukas Fleischer) Date: Sat, 6 Apr 2013 11:11:23 +0200 Subject: [PATCH] html.c: Replace strdup() with xstrdup() Message-ID: <1365239483-14912-1-git-send-email-cgit@cryptocrack.de> Use the xstrdup() wrapper which already bails out if strdup() returns a NULL pointer. Signed-off-by: Lukas Fleischer --- `grep '[^x]strdup' *.c` tells me that this is the only place where we still use strdup() instead of xstrdup(). html.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/html.c b/html.c index d60a41f..88f3e67 100644 --- a/html.c +++ b/html.c @@ -306,11 +306,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'; -- 1.8.2.674.g2c8b7bf