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>
This commit is contained in:
rodzic
8f20879431
commit
3edfd83db6
7
html.c
7
html.c
@ -6,6 +6,7 @@
|
|||||||
* (see COPYING for full license text)
|
* (see COPYING for full license text)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "cgit.h"
|
||||||
#include "html.h"
|
#include "html.h"
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
@ -307,11 +308,7 @@ int http_parse_querystring(const char *txt_, void (*fn)(const char *name, const
|
|||||||
if (!txt_)
|
if (!txt_)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
o = t = txt = strdup(txt_);
|
o = t = txt = xstrdup(txt_);
|
||||||
if (t == NULL) {
|
|
||||||
printf("Out of memory\n");
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
while ((c=*t) != '\0') {
|
while ((c=*t) != '\0') {
|
||||||
if (c == '=') {
|
if (c == '=') {
|
||||||
*t = '\0';
|
*t = '\0';
|
||||||
|
Ładowanie…
Reference in New Issue
Block a user