Skip to content

Commit

Permalink
[proto_hep][bugfix] check memory allocation
Browse files Browse the repository at this point in the history
  • Loading branch information
ionutrazvanionita committed Apr 22, 2016
1 parent 943d901 commit f5ad753
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions modules/proto_hep/hep.c
Expand Up @@ -746,6 +746,12 @@ int unpack_hepv3(char *buf, int len, struct hep_desc *h)

gen_chunk->data =
shm_malloc(gen_chunk->chunk.length - sizeof(hep_chunk_t));

if (gen_chunk->data == NULL) {
LM_ERR("no more shared memory!\n");
return -1;
}

memcpy(gen_chunk->data, (char *)buf + sizeof(hep_chunk_t),
gen_chunk->chunk.length - sizeof(hep_chunk_t));

Expand Down

0 comments on commit f5ad753

Please sign in to comment.