From 2b5ddafab582326cefcb612ba86cf1921d49eafd Mon Sep 17 00:00:00 2001 From: Nicolas Williams Date: Mon, 29 Feb 2016 11:50:34 -0600 Subject: [PATCH] HDB sqlite backend: fix error NULL deref --- lib/hdb/hdb-sqlite.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/hdb/hdb-sqlite.c b/lib/hdb/hdb-sqlite.c index a3c607dbd..d3461d018 100644 --- a/lib/hdb/hdb-sqlite.c +++ b/lib/hdb/hdb-sqlite.c @@ -449,12 +449,12 @@ hdb_sqlite_make_database(krb5_context context, HDB *db, const char *filename) return 0; out: - free(hsdb->db_file); - hsdb->db_file = NULL; if (hsdb->db) sqlite3_close(hsdb->db); if (created_file) unlink(hsdb->db_file); + free(hsdb->db_file); + hsdb->db_file = NULL; return ret; }