Browse code

db_berkeley: reset lkey to avoid double free

Daniel-Constantin Mierla authored on 05/05/2022 17:52:11
Showing 1 changed files
... ...
@@ -1055,8 +1055,10 @@ int bdb_update(db1_con_t *_con, db_key_t *_k, db_op_t *_op, db_val_t *_v,
1055 1055
 		goto cleanup;
1056 1056
 	}
1057 1057
 
1058
-	if(lkey)
1058
+	if(lkey) {
1059 1059
 		pkg_free(lkey);
1060
+		lkey = NULL;
1061
+	}
1060 1062
 
1061 1063
 	key.data = kbuf;
1062 1064
 	key.ulen = MAX_ROW_SIZE;