Skip to content

Commit

Permalink
snmpstats: fix allocator sizeof operand mismatch
Browse files Browse the repository at this point in the history
(cherry picked from commit 0c99fed)
  • Loading branch information
miconda committed May 5, 2022
1 parent db3fb40 commit bb63c12
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/modules/snmpstats/snmpSIPRegUserLookupTable.c
Expand Up @@ -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);
Expand Down Expand Up @@ -776,4 +776,4 @@ kamailioSIPRegUserLookupTable_get_by_idx(netsnmp_index *hdr)
{
return (const kamailioSIPRegUserLookupTable_context *)CONTAINER_FIND(
cb.container, hdr);
}
}
4 changes: 2 additions & 2 deletions src/modules/snmpstats/snmpSIPRegUserTable.c
Expand Up @@ -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);
Expand Down Expand Up @@ -378,4 +378,4 @@ const kamailioSIPRegUserTable_context *kamailioSIPRegUserTable_get_by_idx(
{
return (const kamailioSIPRegUserTable_context *)CONTAINER_FIND(
cb.container, hdr);
}
}

0 comments on commit bb63c12

Please sign in to comment.