Page MenuHomeFreeBSD

D15550.id.diff
No OneTemporary

D15550.id.diff

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

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)

Event Timeline