소스 검색

db_redis: free db vals on error

Daniel-Constantin Mierla 3 년 전
부모
커밋
89495b8595
1개의 변경된 파일3개의 추가작업 그리고 1개의 파일을 삭제
  1. 3 1
      src/modules/db_redis/redis_dbase.c

+ 3 - 1
src/modules/db_redis/redis_dbase.c

@@ -2164,6 +2164,8 @@ static int db_redis_perform_update(const db1_con_t* _h, km_redis_con_t *con, con
         if (db_redis_build_type_keys(con, CON_TABLE(_h), db_keys, db_vals, all_type_keys_count,
                     &type_keys, &set_keys, &type_keys_count) != 0) {
             LM_ERR("failed to build type keys\n");
+            pkg_free(db_vals);
+            db_vals = NULL;
             goto error;
         }
         pkg_free(db_keys);
@@ -2306,7 +2308,7 @@ static int db_redis_perform_update(const db1_con_t* _h, km_redis_con_t *con, con
 
                 if (scard != 0)
                     continue;
-                
+
                 if (db_redis_key_add_string(&query_v, "SREM", 4) != 0) {
                     LM_ERR("Failed to add srem command to post-delete query\n");
                     goto error;