1
0
Fork 0

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>
Dieser Commit ist enthalten in:
Lukas Fleischer 2013-04-06 13:30:54 +02:00 committet von Jason A. Donenfeld
Ursprung 8f20879431
Commit 3edfd83db6
1 geänderte Dateien mit 2 neuen und 5 gelöschten Zeilen

7
html.c
Datei anzeigen

@ -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';