Skip to content

Commit

Permalink
memset all connection memory to 0 to avoid unwanted values
Browse files Browse the repository at this point in the history
  • Loading branch information
ionutrazvanionita committed Sep 29, 2015
1 parent 4963c7c commit ad8011a
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions modules/dialplan/dp_db.c
Expand Up @@ -811,14 +811,13 @@ dp_connection_list_p dp_add_connection(dp_head_p head)
+ head->partition.len + head->dp_db_url.len;
el = shm_malloc(all_size);

if(!el)
LM_ERR("No more shm\n");

if (!el) {
LM_ERR("No more shm mem\n");
return NULL;
}

memset(el, 0, sizeof(dp_connection_list_t));

/* create & init lock */
if((el->ref_lock = lock_init_rw()) == NULL) {
LM_ERR("Failed to init lock\n");
Expand Down

1 comment on commit ad8011a

@petekelly
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ionutrazvanionita Thank you, it looks like that has done the trick.

Please sign in to comment.