]> git.ipfire.org Git - thirdparty/krb5.git/commitdiff
Fix various result checks
authorNickolai Zeldovich <nickolai@csail.mit.edu>
Fri, 22 Feb 2013 23:52:21 +0000 (18:52 -0500)
committerTom Yu <tlyu@mit.edu>
Fri, 22 Feb 2013 23:56:41 +0000 (18:56 -0500)
Correct three cases where the wrong expression was checked to see if
an allocation function returned null.

[ghudson@mit.edu: commit message, patch splitting]
[tlyu@mit.edu: omit inapplicable lib/kadm/srv/svr_principal.c change]

(back ported from commit a9ee4a040eeacab1d410ff9e4c862484b531c401)

ticket: 7582
version_fixed: 1.10.4
status: resolved

src/plugins/kdb/db2/libdb2/hash/hash_bigkey.c
src/plugins/preauth/pkinit/pkinit_crypto_openssl.c

index 6874f470378581cc855beec6413a79b3ea70dd4d..c6fe04ad1139a9815a49893fdfbfabf103a3d9ea 100644 (file)
@@ -303,7 +303,7 @@ __get_bigkey(hashp, pagep, ndx, key)
 
        key_pagep =
            __get_page(hashp, OADDR_TO_PAGE(DATA_OFF(pagep, ndx)), A_RAW);
-       if (!pagep)
+       if (!key_pagep)
                return (-1);
        key->size = collect_key(hashp, key_pagep, 0, NULL);
        key->data = hashp->bigkey_buf;
index 7021ff68685f7c0d9e0fc77f320e7990beb9ac62..c6e3f903a949d890812bbf05e790af85515f5d6f 100644 (file)
@@ -3614,7 +3614,7 @@ prepare_enc_data(unsigned char *indata,
     asn1_const_Finish(&c);
 
     *outdata = malloc((size_t)Tlen);
-    if (outdata == NULL) {
+    if (*outdata == NULL) {
         retval = ENOMEM;
         goto cleanup;
     }