Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F106122616
D15550.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
790 B
Referenced Files
None
Subscribers
None
D15550.id.diff
View Options
Index: head/usr.sbin/bhyve/bhyverun.c
===================================================================
--- head/usr.sbin/bhyve/bhyverun.c
+++ head/usr.sbin/bhyve/bhyverun.c
@@ -193,6 +193,7 @@
c = 1, n = 1, s = 1, t = 1;
ns = false, scts = false;
str = strdup(opt);
+ assert(str != NULL);
while ((cp = strsep(&str, ",")) != NULL) {
if (sscanf(cp, "%i%n", &tmp, &chk) == 1) {
@@ -218,11 +219,13 @@
} else if (cp[0] == '\0')
continue;
else
- return (-1);
+ goto out;
/* Any trailing garbage causes an error */
if (cp[chk] != '\0')
- return (-1);
+ goto out;
}
+ free(str);
+
/*
* Range check 1 <= n <= UINT16_MAX all values
*/
@@ -248,6 +251,10 @@
cores = c;
threads = t;
return(0);
+
+out:
+ free(str);
+ return (-1);
}
static int
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Dec 26, 6:56 PM (7 h, 47 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
15606462
Default Alt Text
D15550.id.diff (790 B)
Attached To
Mode
D15550: Fix a memory leak on topology_parse().
Attached
Detach File
Event Timeline
Log In to Comment