From fddbba872abe011277eea826380cdfb2d12aec2d Mon Sep 17 00:00:00 2001 From: Love Hornquist Astrand Date: Wed, 6 Oct 2010 21:37:50 -0700 Subject: [PATCH] if db_create() returns non zero, fail --- lib/hdb/db3.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/hdb/db3.c b/lib/hdb/db3.c index 8cb686678..d66666ee9 100644 --- a/lib/hdb/db3.c +++ b/lib/hdb/db3.c @@ -269,7 +269,11 @@ DB_open(krb5_context context, HDB *db, int flags, mode_t mode) krb5_set_error_message(context, ENOMEM, "malloc: out of memory"); return ENOMEM; } - db_create(&d, NULL, 0); + if (db_create(&d, NULL, 0) != 0) { + free(fn); + krb5_set_error_message(context, ENOMEM, "malloc: out of memory"); + return ENOMEM; + } db->hdb_db = d; #if (DB_VERSION_MAJOR >= 4) && (DB_VERSION_MINOR >= 1) -- 2.11.4.GIT