[SSSD] [PATCH] Avoid a potential double-free

Sumit Bose sbose at redhat.com
Wed Jun 9 11:06:25 UTC 2010


Hi,

this patch should fix #527 by setting the pointer to NULL after free.
This issue could be triggered if retries are configured and sssd does
not return a domain name.

bye,
Sumit
-------------- next part --------------
From 30288aa01c302912bbf3415e3ea2118764f3bfb8 Mon Sep 17 00:00:00 2001
From: Sumit Bose <sbose at redhat.com>
Date: Wed, 9 Jun 2010 13:02:47 +0200
Subject: [PATCH] Avoid a potential double-free

---
 src/sss_client/pam_sss.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/src/sss_client/pam_sss.c b/src/sss_client/pam_sss.c
index 1290add..2faa3ad 100644
--- a/src/sss_client/pam_sss.c
+++ b/src/sss_client/pam_sss.c
@@ -212,6 +212,7 @@ static void overwrite_and_free_pam_items(struct pam_items *pi)
     pi->pamstack_oldauthtok = NULL;
 
     free(pi->domain_name);
+    pi->domain_name = NULL;
 }
 
 static int pack_message_v3(struct pam_items *pi, size_t *size,
-- 
1.7.0.1



More information about the sssd-devel mailing list