Make coverity shut up.
Coverity cid 44
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
char *new_str;
char *tok, *p, *port_str, *saveptr;
int len, pos;
- char buf[strlen(orig_str) + 1];
- strcpy(buf, orig_str);
+ char *buf = strdup(orig_str);
len = BUF_SIZE;
new_str = (char *)malloc(len);
if (r < 0) {
printf("server name not found: %s (%s)\n", tok, strerror(errno));
free(new_str);
+ free(buf);
return 0;
}
}
//printf("new_str is '%s'\n", new_str);
+ free(buf);
return new_str;
}
char *mount_path;
char *src;
char *buf = strdup(orig_str);
+
mount_path = strrchr(buf, ':');
if (!mount_path) {
printf("source mount path was not specified\n");