Browse code

db_redis: Fix free(0) on inserting null value

Andreas Granig authored on 12/03/2018 15:21:27
Showing 1 changed files
... ...
@@ -1850,7 +1850,8 @@ int db_redis_insert(const db1_con_t* _h, const db_key_t* _k, const db_val_t* _v,
1850 1850
             LM_ERR("Failed to add column value to insert query\n");
1851 1851
             goto error;
1852 1852
         }
1853
-        pkg_free(v.s);
1853
+        if (v.s)
1854
+            pkg_free(v.s);
1854 1855
     }
1855 1856
 
1856 1857
     reply = db_redis_command_argv(con, query_v);