Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F139349575
D34301.id102841.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D34301.id102841.diff
View Options
Index: usr.sbin/bhyve/bhyverun.c
===================================================================
--- usr.sbin/bhyve/bhyverun.c
+++ usr.sbin/bhyve/bhyverun.c
@@ -270,7 +270,7 @@
static int
topology_parse(const char *opt)
{
- char *cp, *str;
+ char *cp, *str, *ostr;
if (*opt == '\0') {
set_config_value("sockets", "1");
@@ -280,7 +280,7 @@
return (0);
}
- str = strdup(opt);
+ ostr = str = strdup(opt);
if (str == NULL)
errx(4, "Failed to allocate memory");
@@ -302,11 +302,11 @@
else
set_config_value("cpus", cp);
}
- free(str);
+ free(ostr);
return (0);
out:
- free(str);
+ free(ostr);
return (-1);
}
Index: usr.sbin/bhyve/bootrom.c
===================================================================
--- usr.sbin/bhyve/bootrom.c
+++ usr.sbin/bhyve/bootrom.c
@@ -196,13 +196,13 @@
struct stat sbuf;
ssize_t rlen;
off_t rom_size, var_size, total_size;
- char *ptr, *varfile;
+ char *ptr, *varfile, *ostr;
int fd, varfd, i, rv;
rv = -1;
varfd = -1;
- varfile = strdup(romfile);
+ ostr = varfile = strdup(romfile);
romfile = strsep(&varfile, ",");
fd = open(romfile, O_RDONLY);
@@ -293,5 +293,6 @@
done:
if (fd >= 0)
close(fd);
+ free(ostr);
return (rv);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Dec 12, 2:43 AM (11 h, 34 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
26886456
Default Alt Text
D34301.id102841.diff (1 KB)
Attached To
Mode
D34301: bhyve: memory leak in topology_parse()
Attached
Detach File
Event Timeline
Log In to Comment