2
0
Эх сурвалжийг харах

snmpstats: fix allocator sizeof operand mismatch

Daniel-Constantin Mierla 3 жил өмнө
parent
commit
0c99fed484

+ 2 - 2
src/modules/snmpstats/snmpSIPRegUserLookupTable.c

@@ -520,7 +520,7 @@ void kamailioSIPRegUserLookupTable_set_action(netsnmp_request_group *rg)
 			case COLUMN_KAMAILIOSIPREGUSERLOOKUPURI:
 
 				row_ctx->kamailioSIPRegUserLookupURI =
-						pkg_malloc(sizeof(char) * (var->val_len + 1));
+						pkg_malloc(sizeof(unsigned char) * (var->val_len + 1));
 
 				memcpy(row_ctx->kamailioSIPRegUserLookupURI, var->val.string,
 						var->val_len);
@@ -776,4 +776,4 @@ kamailioSIPRegUserLookupTable_get_by_idx(netsnmp_index *hdr)
 {
 	return (const kamailioSIPRegUserLookupTable_context *)CONTAINER_FIND(
 			cb.container, hdr);
-}
+}

+ 2 - 2
src/modules/snmpstats/snmpSIPRegUserTable.c

@@ -248,7 +248,7 @@ int createRegUserRow(char *stringToRegister)
 	theRow->kamailioSIPUserIndex = index;
 
 	theRow->kamailioSIPUserUri =
-			(unsigned char *)pkg_malloc(stringLength * sizeof(char));
+			(unsigned char *)pkg_malloc(stringLength * sizeof(unsigned char));
 	if(theRow->kamailioSIPUserUri == NULL) {
 		pkg_free(OIDIndex);
 		free(theRow);
@@ -378,4 +378,4 @@ const kamailioSIPRegUserTable_context *kamailioSIPRegUserTable_get_by_idx(
 {
 	return (const kamailioSIPRegUserTable_context *)CONTAINER_FIND(
 			cb.container, hdr);
-}
+}