You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gentoo-overlay/sys-apps/arrayprobe/files/2.0-malloc-strlen.patch

21 lines
1.1 KiB

--- probe.c.old 2010-01-13 12:15:32.000000000 +0100
+++ probe.c 2010-01-13 12:16:44.000000000 +0100
@@ -354,7 +354,7 @@
int drivenum = event.detail.logstatchange.logicaldrivenumber;
logdrvs[drivenum].state.state = event.detail.logstatchange.newlogicaldrivestate;
logdrvs[drivenum].state.severity = logicaldrivestatusseverity[event.detail.logstatchange.newlogicaldrivestate];
- logdrvs[drivenum].state.message = (char *)malloc(strlen(logicaldrivestatusstr[event.detail.logstatchange.newlogicaldrivestate] + 1));
+ logdrvs[drivenum].state.message = (char *)malloc(strlen(logicaldrivestatusstr[event.detail.logstatchange.newlogicaldrivestate]) + 1);
strcpy (logdrvs[drivenum].state.message, logicaldrivestatusstr[event.detail.logstatchange.newlogicaldrivestate]);
}
if (verbose) {
@@ -479,7 +479,7 @@
int ida_device = 0; /* only for use with -f , used to determine protocol to use */
int max_logical = 64; /* hardcoded */
int cur_logical = 0; /* number of drives detected */
- logdrv *logdrvs = (logdrv *)malloc(sizeof(logdrv)*max_logical);
+ logdrv *logdrvs;
int worst_disk;
int worst_sev = SEV_NORMAL;
int cntr;