X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Frrd_info.c;h=5722025384cd1fed366b92434d074124cc4ca237;hb=bcc67021230da610a064324088e42f9629f073ca;hp=d86a9074d90e631184d04e758652fa7788375c84;hpb=e5b05bec82bbff5db8add4e58dd6f0fcf2670291;p=rrdtool.git diff --git a/src/rrd_info.c b/src/rrd_info.c index d86a907..5722025 100644 --- a/src/rrd_info.c +++ b/src/rrd_info.c @@ -71,8 +71,7 @@ rrd_info_t next->value.u_int = value.u_int; break; case RD_I_STR: - next->value.u_str = (char*)malloc(sizeof(char) * (strlen(value.u_str) + 1)); - strcpy(next->value.u_str, value.u_str); + next->value.u_str = strdup(value.u_str); break; case RD_I_BLO: next->value.u_blo.size = value.u_blo.size; @@ -152,6 +151,7 @@ rrd_info_t *rrd_info( else info = rrd_info_r(argv[optind]); + if (opt_daemon) free(opt_daemon); return (info); } /* rrd_info_t *rrd_info */