Diff of /libop/op_events.c [3b11e2] .. [6ee980]  Maximize  Restore

Switch to side-by-side view

--- a/libop/op_events.c
+++ b/libop/op_events.c
@@ -256,6 +256,7 @@
 {
 	list_del(&um->um_next);
 	free(um);
+	um = NULL;
 }
 
 /*
@@ -289,8 +290,6 @@
 		} else {
 			if (!um)
 				parse_error("no unit mask name line");
-			if (um->num >= MAX_UNIT_MASK)
-				parse_error("oprofile: maximum unit mask entries exceeded");
 
 			parse_um_entry(&um->um[um->num], line);
 			++(um->num);
@@ -561,6 +560,7 @@
 				c = skip_ws(c);
 				if (*c != '\0' && *c != '#')
 					parse_error("non whitespace after include:");
+				break;
 			} else {
 				parse_error("unknown tag");
 			}
@@ -1037,7 +1037,7 @@
 	for (i = 1; i < evt.unit->num; i++) {
 		int j = i - 1;
 		u32 tmp = evt.unit->um[i].value;
-		while (tmp < evt.unit->um[j].value && j >= 0) {
+		while (j >= 0 && tmp < evt.unit->um[j].value) {
 			evt.unit->um[j + 1].value = evt.unit->um[j].value;
 			j -= 1;
 		}
@@ -1089,8 +1089,6 @@
 		}
 	}
 
-	free(tmp_um);
-	free(tmp_um_no_dups);
 	if (dup_value_used) {
 		fprintf(stderr, "Ambiguous bitmask: Unit mask values"
 		        " cannot include non-unique numerical values (i.e., 0x%x).\n",
@@ -1100,6 +1098,8 @@
 	} else if (masked_val == passed_um && passed_um != 0) {
 		retval = 1;
 	}
+	free(tmp_um);
+	free(tmp_um_no_dups);
 	return retval;
 }
 

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks