Diffstat (limited to 'html.c')
| -rw-r--r-- | html.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -6,7 +6,6 @@ * (see COPYING for full license text) */ -#include "cgit.h" #include "html.h" #include <unistd.h> #include <stdio.h> @@ -308,7 +307,11 @@ int http_parse_querystring(const char *txt_, void (*fn)(const char *name, const if (!txt_) return 0; - o = t = txt = xstrdup(txt_); + o = t = txt = strdup(txt_); + if (t == NULL) { + printf("Out of memory\n"); + exit(1); + } while ((c=*t) != '\0') { if (c == '=') { *t = '\0'; |