Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F109271900
D36827.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
778 B
Referenced Files
None
Subscribers
None
D36827.diff
View Options
diff --git a/sbin/nvmecontrol/modules/wdc/wdc.c b/sbin/nvmecontrol/modules/wdc/wdc.c
--- a/sbin/nvmecontrol/modules/wdc/wdc.c
+++ b/sbin/nvmecontrol/modules/wdc/wdc.c
@@ -268,7 +268,7 @@
wdc_get_dui_log_size(int fd, uint32_t opcode, uint8_t data_area,
uint64_t *log_size, int len_off)
{
- uint8_t *hdr;
+ uint8_t *hdr, *tofree;
uint8_t max_sections;
int i, j;
uint16_t hdr_ver;
@@ -277,7 +277,7 @@
dui_size = 0;
len = 1024;
- hdr = (uint8_t*)malloc(len);
+ tofree = hdr = (uint8_t*)malloc(len);
if (hdr == NULL)
errx(EX_OSERR, "Can't get buffer to read header");
wdc_get_data_dui(fd, opcode, len, 0, hdr, len);
@@ -315,7 +315,7 @@
errx(EX_PROTOCOL, "ERROR : No valid header ");
*log_size = dui_size;
- free(hdr);
+ free(tofree);
}
static void
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Feb 3, 9:14 PM (21 h, 3 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
16442680
Default Alt Text
D36827.diff (778 B)
Attached To
Mode
D36827: nvmecontrol wdc: Don't pass a bogus pointer to free().
Attached
Detach File
Event Timeline
Log In to Comment