Explorar o código

db_berkeley: reset lkey to avoid double free

Daniel-Constantin Mierla %!s(int64=3) %!d(string=hai) anos
pai
achega
33228bba33
Modificáronse 1 ficheiros con 3 adicións e 1 borrados
  1. 3 1
      src/modules/db_berkeley/db_berkeley.c

+ 3 - 1
src/modules/db_berkeley/db_berkeley.c

@@ -1055,8 +1055,10 @@ int bdb_update(db1_con_t *_con, db_key_t *_k, db_op_t *_op, db_val_t *_v,
 		goto cleanup;
 	}
 
-	if(lkey)
+	if(lkey) {
 		pkg_free(lkey);
+		lkey = NULL;
+	}
 
 	key.data = kbuf;
 	key.ulen = MAX_ROW_SIZE;