]> git.ipfire.org Git - thirdparty/krb5.git/commitdiff
Always set appdefault_get() output argument 721/head
authorNehal J Wani <nehaljw.kkd1@gmail.com>
Sun, 28 Jan 2018 08:02:57 +0000 (03:02 -0500)
committerGreg Hudson <ghudson@mit.edu>
Tue, 30 Jan 2018 18:07:54 +0000 (13:07 -0500)
gcc 7 cannot determine that appdefault_get() always sets *ret_value
when it returns zero, so issues a "may be used uninitialized" warning
in its caller.  Set *ret_value at the beginning of the function body
in accordance with current practices.

[ghudson@mit.edu: clarified commit message]

ticket: 8639 (new)
tags: pullup
target_version: 1.16-next
target_version: 1.15-next

src/lib/krb5/krb/appdefault.c

index 73fd2605e82e58d5b2a39e7ea8457f405f0399d8..3f7dc2377f87201c147c23399609a1bfe51b3f02 100644 (file)
@@ -44,6 +44,8 @@ appdefault_get(krb5_context context, const char *appname, const krb5_data *realm
     krb5_error_code retval;
     const char * realmstr =  realm?realm->data:NULL;
 
+    *ret_value = NULL;
+
     if (!context || (context->magic != KV5M_CONTEXT))
         return KV5M_CONTEXT;