summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Karl Ramm <kcr@1ts.org>2010-11-08 03:58:58 +0000
committerGravatar Karl Ramm <kcr@1ts.org>2010-11-08 03:58:58 +0000
commit4371d4d992c58c9e8737e9ec5284199b4b523a25 (patch)
tree09daa758e5cceb1c6228bcf398eaf697e33e29c3
parentb67aa4448d1234e7976b40449a1ef3857107c1e8 (diff)
check the return code from krb5_get_default_realm _before_ dereferencing
the pointer
-rw-r--r--lib/ZInit.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/ZInit.c b/lib/ZInit.c
index 8339cf3..23dd4af 100644
--- a/lib/ZInit.c
+++ b/lib/ZInit.c
@@ -156,14 +156,14 @@ ZInitialize(void)
char *p; /* XXX define this somewhere portable */
/* XXX check ticket file here */
code = krb5_get_default_realm(Z_krb5_ctx, &p);
+ if (code)
+ return code;
strcpy(__Zephyr_realm, p);
#ifdef HAVE_KRB5_FREE_DEFAULT_REALM
krb5_free_default_realm(Z_krb5_ctx, p);
#else
free(p);
#endif
- if (code)
- return code;
}
#else
#ifdef HAVE_KRB4