summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: b062e6d)
raw | patch | inline | side by side (parent: b062e6d)
author | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Fri, 14 Nov 2003 23:10:51 +0000 (23:10 +0000) | ||
committer | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Fri, 14 Nov 2003 23:10:51 +0000 (23:10 +0000) |
program/src/rrd_cgi.c | patch | blob | history |
diff --git a/program/src/rrd_cgi.c b/program/src/rrd_cgi.c
index 4543044c2ad445938dad2a9c536d0bf9ab17f1d4..7f248ab04f1feac44885bd971bce88bb7d89e889 100644 (file)
--- a/program/src/rrd_cgi.c
+++ b/program/src/rrd_cgi.c
/* create freeable version of the string */
char * stralloc(char *str){
- char *nstr = malloc((strlen(str)+1)*sizeof(char));
+ char *nstr;
+ if (str == NULL) {
+ return NULL;
+ }
+ nstr = malloc((strlen(str)+1)*sizeof(char));
strcpy(nstr,str);
return(nstr);
}