From bdc1508a068af7d9fb3d401922c0f2d8b012d8dc Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Sun, 20 Mar 2011 19:56:55 -0500 Subject: [PATCH] Fix assignment before NULL check Easy fix, found using null_ref.cocci example Coccinelle script. Signed-off-by: Dan McGee --- lib/libalpm/be_local.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libalpm/be_local.c b/lib/libalpm/be_local.c index c3461b77..c13dffb4 100644 --- a/lib/libalpm/be_local.c +++ b/lib/libalpm/be_local.c @@ -995,10 +995,10 @@ pmdb_t *_alpm_db_register_local(void) _alpm_log(PM_LOG_DEBUG, "registering local database\n"); db = _alpm_db_new("local", 1); - db->ops = &local_db_ops; if(db == NULL) { RET_ERR(PM_ERR_DB_CREATE, NULL); } + db->ops = &local_db_ops; handle->db_local = db; return(db);