Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F177639482
D4450.1794919724.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None
D4450.1794919724.diff
View Options
Index: sbin/geom/class/multipath/geom_multipath.c
===================================================================
--- sbin/geom/class/multipath/geom_multipath.c
+++ sbin/geom/class/multipath/geom_multipath.c
@@ -162,6 +162,9 @@
return;
}
+ rsector = NULL;
+ sector = NULL;
+
/*
* First, check each provider to make sure it's the same size.
* This also gets us our size and sectorsize for the metadata.
@@ -221,17 +224,15 @@
/*
* Allocate a sector to write as metadata.
*/
- sector = malloc(secsize);
+ sector = calloc(1, secsize);
if (sector == NULL) {
gctl_error(req, "unable to allocate metadata buffer");
return;
}
- memset(sector, 0, secsize);
rsector = malloc(secsize);
if (rsector == NULL) {
- free(sector);
gctl_error(req, "unable to allocate metadata buffer");
- return;
+ goto done;
}
/*
@@ -246,7 +247,7 @@
error = g_metadata_store(name, sector, secsize);
if (error != 0) {
gctl_error(req, "cannot store metadata on %s: %s.", name, strerror(error));
- return;
+ goto done;
}
/*
@@ -274,6 +275,9 @@
name2, name);
}
}
+done:
+ free(rsector);
+ free(sector);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Nov 17, 12:48 PM (5 h, 18 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
41799971
Default Alt Text
D4450.1794919724.diff (1 KB)
Attached To
Mode
D4450: Don't leak rsector/sector in mp_label(..); use calloc instead of malloc + memset
Attached
Detach File
Event Timeline