[SSSD] [PATCH] ldap_child: initialized ccname_file_dummy

Sumit Bose sbose at redhat.com
Fri Mar 6 10:41:25 UTC 2015


Hi,

this patch should fix the following compiler warning:

 CC       src/providers/ldap/ldap_child-ldap_child.o
../src/providers/ldap/ldap_child.c: In Funktion »main«:
../src/providers/ldap/ldap_child.c:503:160: Warnung: »ccname_file_dummy«
könnte in dieser Funktion uninitialisiert verwendet werden
[-Wmaybe-uninitialized]
         DEBUG(SSSDBG_TRACE_INTERNAL, "Unlinking [%s]\n",
ccname_file_dummy);
                                                                                                                                                                ^
../src/providers/ldap/ldap_child.c:275:11: Anmerkung:
»ccname_file_dummy« wurde hier deklariert
     char *ccname_file_dummy;
           ^
  CC       src/providers/krb5/ldap_child-krb5_keytab.o

bye,
Sumit
-------------- next part --------------
From d0aa30b21bc85c738a9be9b6a52e0702858d61b1 Mon Sep 17 00:00:00 2001
From: Sumit Bose <sbose at redhat.com>
Date: Fri, 6 Mar 2015 11:27:36 +0100
Subject: [PATCH] ldap_child: initialized ccname_file_dummy

ccname_file_dummy is used in the done-block which is called before
ccname_file_dummy is set to a value. This patch initializes
ccname_file_dummy to NULL.

Related to https://fedorahosted.org/sssd/ticket/2592
---
 src/providers/ldap/ldap_child.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/providers/ldap/ldap_child.c b/src/providers/ldap/ldap_child.c
index 774cff9c2d942b589e69933d3f201f6245fa904d..8f034affa48095b6e512c866f8a3c33465e5c595 100644
--- a/src/providers/ldap/ldap_child.c
+++ b/src/providers/ldap/ldap_child.c
@@ -272,7 +272,7 @@ static krb5_error_code ldap_child_get_tgt_sync(TALLOC_CTX *memctx,
     int kdc_time_offset_usec;
     int ret;
     TALLOC_CTX *tmp_ctx;
-    char *ccname_file_dummy;
+    char *ccname_file_dummy = NULL;
     char *ccname_file;
     mode_t old_umask;
 
-- 
2.1.0



More information about the sssd-devel mailing list