summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: d1e55cd)
raw | patch | inline | side by side (parent: d1e55cd)
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) |
src/rrd_cgi.c | patch | blob | history |
diff --git a/src/rrd_cgi.c b/src/rrd_cgi.c
index 4543044c2ad445938dad2a9c536d0bf9ab17f1d4..7f248ab04f1feac44885bd971bce88bb7d89e889 100644 (file)
--- a/src/rrd_cgi.c
+++ b/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);
}