summaryrefslogtreecommitdiffstats
path: root/crypto/txt_db
diff options
context:
space:
mode:
authorNils Larsch <nils@openssl.org>2005-07-26 23:10:34 +0200
committerNils Larsch <nils@openssl.org>2005-07-26 23:10:34 +0200
commitc755c5fd8ba5771691451e9d1b163544fdadb7ec (patch)
treee9ba80b2ad6965f3803a0d2273b8797258023586 /crypto/txt_db
parentHandle case where it==NULL (diff)
downloadopenssl-c755c5fd8ba5771691451e9d1b163544fdadb7ec.tar.xz
openssl-c755c5fd8ba5771691451e9d1b163544fdadb7ec.zip
improved error checking and some fixes
PR: 1170 Submitted by: Yair Elharrar Reviewed and edited by: Nils Larsch
Diffstat (limited to 'crypto/txt_db')
-rw-r--r--crypto/txt_db/txt_db.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/crypto/txt_db/txt_db.c b/crypto/txt_db/txt_db.c
index b3a7a42ca0..e9e503eb07 100644
--- a/crypto/txt_db/txt_db.c
+++ b/crypto/txt_db/txt_db.c
@@ -179,10 +179,13 @@ err:
#if !defined(OPENSSL_NO_STDIO) && !defined(OPENSSL_SYS_WIN16)
if (er == 1) fprintf(stderr,"OPENSSL_malloc failure\n");
#endif
- if (ret->data != NULL) sk_free(ret->data);
- if (ret->index != NULL) OPENSSL_free(ret->index);
- if (ret->qual != NULL) OPENSSL_free(ret->qual);
- if (ret != NULL) OPENSSL_free(ret);
+ if (ret != NULL)
+ {
+ if (ret->data != NULL) sk_free(ret->data);
+ if (ret->index != NULL) OPENSSL_free(ret->index);
+ if (ret->qual != NULL) OPENSSL_free(ret->qual);
+ if (ret != NULL) OPENSSL_free(ret);
+ }
return(NULL);
}
else