]> 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>
Mon, 22 Apr 2013 23:59:20 +0000 (19:59 -0400)
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)
(cherry picked from commit 2ea07b055f1eb3abbb3a7b7206ab04ff190acf84)

ticket: 7618
version_fixed: 1.9.5
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 51103e803cf63c8634378d95e461be2f162137b6..fb858779d037369838ff665814111b4d777a62a5 100644 (file)
@@ -3248,7 +3248,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;
     }