Skip to content

Commit

Permalink
dispatcher: prevent possibl uninitialized access
Browse files Browse the repository at this point in the history
(cherry picked from commit 5880428)
  • Loading branch information
razvancrainea authored and liviuchircu committed Nov 5, 2020
1 parent 5947bad commit d81fb6c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion modules/dispatcher/dispatcher.c
Expand Up @@ -749,6 +749,8 @@ static inline int check_if_default_head_is_ok(void)
*/
static int mod_init(void)
{
ds_db_head_t *aux;

LM_DBG("initializing ...\n");
init_db_url(default_db_head.db_url, 1 /* can be null */);

Expand Down Expand Up @@ -841,13 +843,13 @@ static int mod_init(void)

/* close DB connection */
ds_disconnect_db(partition);
ds_db_head_t *aux = head_it;

/* We keep track of corespondig default parition */
if (head_it == &default_db_head)
default_partition = partition;

next_part:
aux = head_it;
head_it = head_it->next;
if (aux != &default_db_head)
pkg_free(aux);
Expand Down

0 comments on commit d81fb6c

Please sign in to comment.