|
|
2fc102 |
From 7e60e5991e97443044ae9c097131c84e9538cc42 Mon Sep 17 00:00:00 2001
|
|
|
2fc102 |
From: =?UTF-8?q?Pavel=20B=C5=99ezina?= <pbrezina@redhat.com>
|
|
|
2fc102 |
Date: Tue, 12 Nov 2013 13:41:49 +0100
|
|
|
2fc102 |
Subject: [PATCH 45/47] pac: fix potential memory leaks
|
|
|
2fc102 |
|
|
|
2fc102 |
---
|
|
|
2fc102 |
src/responder/pac/pacsrv_utils.c | 10 +++++-----
|
|
|
2fc102 |
1 file changed, 5 insertions(+), 5 deletions(-)
|
|
|
2fc102 |
|
|
|
2fc102 |
diff --git a/src/responder/pac/pacsrv_utils.c b/src/responder/pac/pacsrv_utils.c
|
|
|
2fc102 |
index a82320fcae3b0494e7b6b322428e3a17ed729b4a..53edcc286119aa4a315285827da96e5d157afec9 100644
|
|
|
2fc102 |
--- a/src/responder/pac/pacsrv_utils.c
|
|
|
2fc102 |
+++ b/src/responder/pac/pacsrv_utils.c
|
|
|
2fc102 |
@@ -82,7 +82,7 @@ errno_t get_sids_from_pac(TALLOC_CTX *mem_ctx,
|
|
|
2fc102 |
hash_key_t key;
|
|
|
2fc102 |
hash_value_t value;
|
|
|
2fc102 |
char *rid_start;
|
|
|
2fc102 |
- struct ldb_result *msg;
|
|
|
2fc102 |
+ struct ldb_result *msg = NULL;
|
|
|
2fc102 |
char *user_sid_str = NULL;
|
|
|
2fc102 |
char *primary_group_sid_str = NULL;
|
|
|
2fc102 |
|
|
|
2fc102 |
@@ -154,8 +154,8 @@ errno_t get_sids_from_pac(TALLOC_CTX *mem_ctx,
|
|
|
2fc102 |
sid_str, NULL, &msg;;
|
|
|
2fc102 |
if (ret == EOK && msg->count == 1) {
|
|
|
2fc102 |
value.ul = ldb_msg_find_attr_as_uint64(msg->msgs[0], SYSDB_UIDNUM, 0);
|
|
|
2fc102 |
- talloc_free(msg);
|
|
|
2fc102 |
}
|
|
|
2fc102 |
+ talloc_zfree(msg);
|
|
|
2fc102 |
|
|
|
2fc102 |
ret = hash_enter(sid_table, &key, &value);
|
|
|
2fc102 |
if (ret != HASH_SUCCESS) {
|
|
|
2fc102 |
@@ -189,8 +189,8 @@ errno_t get_sids_from_pac(TALLOC_CTX *mem_ctx,
|
|
|
2fc102 |
sid_str, NULL, &msg;;
|
|
|
2fc102 |
if (ret == EOK && msg->count == 1) {
|
|
|
2fc102 |
value.ul = ldb_msg_find_attr_as_uint64(msg->msgs[0], SYSDB_GIDNUM, 0);
|
|
|
2fc102 |
- talloc_free(msg);
|
|
|
2fc102 |
}
|
|
|
2fc102 |
+ talloc_zfree(msg);
|
|
|
2fc102 |
|
|
|
2fc102 |
ret = hash_enter(sid_table, &key, &value);
|
|
|
2fc102 |
if (ret != HASH_SUCCESS) {
|
|
|
2fc102 |
@@ -219,8 +219,8 @@ errno_t get_sids_from_pac(TALLOC_CTX *mem_ctx,
|
|
|
2fc102 |
if (ret == EOK && msg->count == 1) {
|
|
|
2fc102 |
value.ul = ldb_msg_find_attr_as_uint64(msg->msgs[0],
|
|
|
2fc102 |
SYSDB_GIDNUM, 0);
|
|
|
2fc102 |
- talloc_free(msg);
|
|
|
2fc102 |
}
|
|
|
2fc102 |
+ talloc_zfree(msg);
|
|
|
2fc102 |
|
|
|
2fc102 |
ret = hash_enter(sid_table, &key, &value);
|
|
|
2fc102 |
if (ret != HASH_SUCCESS) {
|
|
|
2fc102 |
@@ -251,8 +251,8 @@ errno_t get_sids_from_pac(TALLOC_CTX *mem_ctx,
|
|
|
2fc102 |
if (ret == EOK && msg->count == 1 ) {
|
|
|
2fc102 |
value.ul = ldb_msg_find_attr_as_uint64(msg->msgs[0],
|
|
|
2fc102 |
SYSDB_GIDNUM, 0);
|
|
|
2fc102 |
- talloc_free(msg);
|
|
|
2fc102 |
}
|
|
|
2fc102 |
+ talloc_zfree(msg);
|
|
|
2fc102 |
}
|
|
|
2fc102 |
|
|
|
2fc102 |
ret = hash_enter(sid_table, &key, &value);
|
|
|
2fc102 |
--
|
|
|
2fc102 |
1.8.4.2
|
|
|
2fc102 |
|