]> git.ipfire.org Git - thirdparty/krb5.git/commitdiff
Fix various result checks
authorNickolai Zeldovich <nickolai@csail.mit.edu>
Mon, 7 Jan 2013 06:37:19 +0000 (01:37 -0500)
committerGreg Hudson <ghudson@mit.edu>
Mon, 7 Jan 2013 06:37:19 +0000 (01:37 -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]

ticket: 7534
target_version: 1.11.1
tags: pullup

src/lib/kadm5/srv/svr_principal.c
src/plugins/kdb/db2/libdb2/hash/hash_bigkey.c
src/plugins/preauth/pkinit/pkinit_crypto_openssl.c

index 5d858279d30ee96d61aedc2ac688cbfadc0d5180..ae36841a7844b090cf709041539696125a49841e 100644 (file)
@@ -1991,7 +1991,7 @@ make_ks_from_keys(krb5_context context, int n_keys, krb5_keyblock *keyblocks,
     int i;
 
     *ks_tuple = calloc(n_keys, sizeof(**ks_tuple));
-    if (ks_tuple == NULL)
+    if (*ks_tuple == NULL)
         return ENOMEM;
 
     for (i = 0; i < n_keys; i++) {
index e6aa03525a5b7ec0d2788ceab659c304fb70e98a..497939d2d705a3c459de072339f97ea56a83960f 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 dfb45c1b42077f652193f7dc1d3e2d70926ef93a..17c37c66bb32f0e861c42b5c115c4d36a60bc026 100644 (file)
@@ -3619,7 +3619,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;
     }