summaryrefslogtreecommitdiffstats
path: root/src/responder/pac
diff options
context:
space:
mode:
authorPavel Březina <pbrezina@redhat.com>2013-11-12 13:41:49 +0100
committerJakub Hrozek <jhrozek@redhat.com>2013-11-22 15:19:41 +0100
commit9f39fa303b328c4e82ffd6b3d8dfa9b6640222cd (patch)
treeb14226744eaee210fabcadd91486df3eac142def /src/responder/pac
parentb2c2ab134a75e6d326b7103fa59ef4fdb3a270f7 (diff)
downloadsssd-9f39fa303b328c4e82ffd6b3d8dfa9b6640222cd.tar.gz
sssd-9f39fa303b328c4e82ffd6b3d8dfa9b6640222cd.tar.xz
sssd-9f39fa303b328c4e82ffd6b3d8dfa9b6640222cd.zip
pac: fix potential memory leaks
Diffstat (limited to 'src/responder/pac')
-rw-r--r--src/responder/pac/pacsrv_utils.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/responder/pac/pacsrv_utils.c b/src/responder/pac/pacsrv_utils.c
index d3d5e8b60..d56fc1963 100644
--- a/src/responder/pac/pacsrv_utils.c
+++ b/src/responder/pac/pacsrv_utils.c
@@ -82,7 +82,7 @@ errno_t get_sids_from_pac(TALLOC_CTX *mem_ctx,
hash_key_t key;
hash_value_t value;
char *rid_start;
- struct ldb_result *msg;
+ struct ldb_result *msg = NULL;
char *user_sid_str = NULL;
char *primary_group_sid_str = NULL;
@@ -153,8 +153,8 @@ errno_t get_sids_from_pac(TALLOC_CTX *mem_ctx,
ret = sysdb_search_object_by_sid(mem_ctx, user_dom, sid_str, NULL, &msg);
if (ret == EOK && msg->count == 1) {
value.ul = ldb_msg_find_attr_as_uint64(msg->msgs[0], SYSDB_UIDNUM, 0);
- talloc_free(msg);
}
+ talloc_zfree(msg);
ret = hash_enter(sid_table, &key, &value);
if (ret != HASH_SUCCESS) {
@@ -187,8 +187,8 @@ errno_t get_sids_from_pac(TALLOC_CTX *mem_ctx,
ret = sysdb_search_object_by_sid(mem_ctx, user_dom, sid_str, NULL, &msg);
if (ret == EOK && msg->count == 1) {
value.ul = ldb_msg_find_attr_as_uint64(msg->msgs[0], SYSDB_GIDNUM, 0);
- talloc_free(msg);
}
+ talloc_zfree(msg);
ret = hash_enter(sid_table, &key, &value);
if (ret != HASH_SUCCESS) {
@@ -217,8 +217,8 @@ errno_t get_sids_from_pac(TALLOC_CTX *mem_ctx,
if (ret == EOK && msg->count == 1) {
value.ul = ldb_msg_find_attr_as_uint64(msg->msgs[0],
SYSDB_GIDNUM, 0);
- talloc_free(msg);
}
+ talloc_zfree(msg);
ret = hash_enter(sid_table, &key, &value);
if (ret != HASH_SUCCESS) {
@@ -249,8 +249,8 @@ errno_t get_sids_from_pac(TALLOC_CTX *mem_ctx,
if (ret == EOK && msg->count == 1 ) {
value.ul = ldb_msg_find_attr_as_uint64(msg->msgs[0],
SYSDB_GIDNUM, 0);
- talloc_free(msg);
}
+ talloc_zfree(msg);
}
ret = hash_enter(sid_table, &key, &value);