Skip to content

Commit

Permalink
imc: better condition to catch no result of database query
Browse files Browse the repository at this point in the history
(cherry picked from commit 29d7ca7)
  • Loading branch information
miconda committed May 19, 2015
1 parent a897784 commit bae1539
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/imc/imc.c
Expand Up @@ -200,10 +200,10 @@ int add_from_db(void)
LM_ERR("failed to querry table\n");
return -1;
}
if(r_res && r_res->n<=0)
if(r_res==NULL || r_res->n<=0)
{
LM_INFO("the query returned no result\n");
imc_dbf.free_result(imc_db, r_res);
if(r_res) imc_dbf.free_result(imc_db, r_res);
r_res = NULL;
return 0;
}
Expand Down

0 comments on commit bae1539

Please sign in to comment.