diff options
author | Volker Lendecke <vl@samba.org> | 2008-02-25 15:24:49 +0100 |
---|---|---|
committer | Volker Lendecke <vl@samba.org> | 2008-02-25 16:09:26 +0100 |
commit | 317639287886181edf08ccecad1b324e4cc55d0b (patch) | |
tree | 8388cbc402ff784babdfcd892daa87090497a8a1 /source3/libads | |
parent | cd95385207ff2a9c27031dcff19b7b74df3a626f (diff) | |
download | samba-317639287886181edf08ccecad1b324e4cc55d0b.tar.gz samba-317639287886181edf08ccecad1b324e4cc55d0b.tar.bz2 samba-317639287886181edf08ccecad1b324e4cc55d0b.zip |
Fix some warnings
warning: ignoring return value of 'asprintf', declared with attribute warn_unused_result
(This used to be commit ad37b7b0aee265a3e4d8b7552610f4b9a105434d)
Diffstat (limited to 'source3/libads')
-rw-r--r-- | source3/libads/kerberos.c | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/source3/libads/kerberos.c b/source3/libads/kerberos.c index d47e8a3ff1..b37b9a500f 100644 --- a/source3/libads/kerberos.c +++ b/source3/libads/kerberos.c @@ -407,8 +407,8 @@ static char *kerberos_secrets_fetch_salting_principal(const char *service, int e char *key = NULL; char *ret = NULL; - asprintf(&key, "%s/%s/enctype=%d", SECRETS_SALTING_PRINCIPAL, service, enctype); - if (!key) { + if (asprintf(&key, "%s/%s/enctype=%d", + SECRETS_SALTING_PRINCIPAL, service, enctype) == -1) { return NULL; } ret = (char *)secrets_fetch(key, NULL); @@ -438,7 +438,10 @@ static char* des_salt_key( void ) { char *key; - asprintf(&key, "%s/DES/%s", SECRETS_SALTING_PRINCIPAL, lp_realm()); + if (asprintf(&key, "%s/DES/%s", SECRETS_SALTING_PRINCIPAL, + lp_realm()) == -1) { + return NULL; + } return key; } @@ -609,9 +612,13 @@ bool kerberos_secrets_store_salting_principal(const char *service, return False; } if (strchr_m(service, '@')) { - asprintf(&princ_s, "%s", service); + if (asprintf(&princ_s, "%s", service) == -1) { + goto out; + } } else { - asprintf(&princ_s, "%s@%s", service, lp_realm()); + if (asprintf(&princ_s, "%s@%s", service, lp_realm()) == -1) { + goto out; + } } if (smb_krb5_parse_name(context, princ_s, &princ) != 0) { @@ -622,8 +629,9 @@ bool kerberos_secrets_store_salting_principal(const char *service, goto out; } - asprintf(&key, "%s/%s/enctype=%d", SECRETS_SALTING_PRINCIPAL, unparsed_name, enctype); - if (!key) { + if (asprintf(&key, "%s/%s/enctype=%d", + SECRETS_SALTING_PRINCIPAL, unparsed_name, enctype) + == -1) { goto out; } |