[Freeipa-devel] [PATCH] Fix warning: Using uninitialized value ld.

Lukas Slebodnik lslebodn at redhat.com
Sat Jul 12 18:40:54 UTC 2014


ehlo,

If create_getkeytab_control fails variable uninitialized pointer 'ld'
will be used in done section.

Simple patch is attached.
-------------- next part --------------
>From 6d882d2ede4d639dde2883bb147f3921fc46ae1c Mon Sep 17 00:00:00 2001
From: Lukas Slebodnik <lslebodn at redhat.com>
Date: Sat, 12 Jul 2014 18:18:21 +0200
Subject: [PATCH 1/4] Fix warning: Using uninitialized value ld.

If create_getkeytab_control fails variable uninitialized pointer 'ld' will be
used.
---
 ipa-client/ipa-getkeytab.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ipa-client/ipa-getkeytab.c b/ipa-client/ipa-getkeytab.c
index d0e975f1a24f15d6b8d109864e5af3548bcba4da..c887cff9bb5e3688cc84b5c28f791eb922f4fe61 100644
--- a/ipa-client/ipa-getkeytab.c
+++ b/ipa-client/ipa-getkeytab.c
@@ -569,7 +569,7 @@ static int ldap_get_keytab(krb5_context krbctx, bool generate, char *password,
     struct krb_key_salt *es = NULL;
     int num_es = 0;
     struct berval *control = NULL;
-    LDAP *ld;
+    LDAP *ld = NULL;
     LDAPControl **srvctrl = NULL;
     BerElement *ber = NULL;
     ber_tag_t rtag;
-- 
1.9.3



More information about the Freeipa-devel mailing list