Skip to content

Commit

Permalink
uid_domain: avoid double free in case of error
Browse files Browse the repository at this point in the history
  • Loading branch information
miconda committed Jul 20, 2017
1 parent dadd54a commit c5cdd8d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/modules/uid_domain/domain.c
Expand Up @@ -244,7 +244,7 @@ int load_domains(domain_t** dest)

list = 0;

if (db_exec(&res, load_domains_cmd) < 0) {
if ((db_exec(&res, load_domains_cmd) < 0) || (res==NULL)) {
ERR("Error while querying database\n");
return -1;
}
Expand Down Expand Up @@ -292,6 +292,7 @@ int load_domains(domain_t** dest)
}

db_res_free(res);
res = NULL;

if (load_domain_attrs) {
d = list;
Expand Down

0 comments on commit c5cdd8d

Please sign in to comment.