Skip to content

Commit f396a39

Browse files
committed
sqlops: fix build with gcc-14
sqlops_impl.c: In function ‘ops_sql_api_insert’: sqlops_impl.c:910:12: error: ‘Jcols’ may be used uninitialized [-Werror=maybe-uninitialized] 910 | if (Jcols) cJSON_Delete(Jcols); | ^
1 parent 1c7153e commit f396a39

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

modules/sqlops/sqlops_impl.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -843,7 +843,7 @@ static inline int _parse_json_col_and_filter( str *cols, str *filter,
843843
int ops_sql_api_select(struct db_url *url, struct sip_msg* msg, str *cols,
844844
str *table, str *filter, str * order, pvname_list_t* dest, int one_col)
845845
{
846-
cJSON *Jcols, *Jfilter;
846+
cJSON *Jcols = NULL, *Jfilter;
847847
int ret;
848848

849849
ret = _parse_json_col_and_filter( cols, filter, &Jcols, &Jfilter);
@@ -868,7 +868,7 @@ int ops_sql_api_select(struct db_url *url, struct sip_msg* msg, str *cols,
868868
int ops_sql_api_update(struct db_url *url, struct sip_msg* msg, str *cols,
869869
str *table, str *filter)
870870
{
871-
cJSON *Jcols, *Jfilter;
871+
cJSON *Jcols = NULL, *Jfilter;
872872
int ret;
873873

874874
ret = _parse_json_col_and_filter( cols, filter, &Jcols, &Jfilter);
@@ -892,7 +892,7 @@ int ops_sql_api_update(struct db_url *url, struct sip_msg* msg, str *cols,
892892
int ops_sql_api_insert(struct db_url *url, struct sip_msg* msg, str *table,
893893
str *cols)
894894
{
895-
cJSON *Jcols, *Jfilter;
895+
cJSON *Jcols = NULL, *Jfilter;
896896
int ret;
897897

898898
ret = _parse_json_col_and_filter( cols, NULL, &Jcols, &Jfilter);
@@ -916,7 +916,7 @@ int ops_sql_api_insert(struct db_url *url, struct sip_msg* msg, str *table,
916916
int ops_sql_api_delete(struct db_url *url, struct sip_msg* msg,
917917
str *table, str *filter)
918918
{
919-
cJSON *Jcols, *Jfilter;
919+
cJSON *Jcols = NULL, *Jfilter;
920920
int ret;
921921

922922
ret = _parse_json_col_and_filter( NULL, filter, &Jcols, &Jfilter);
@@ -940,7 +940,7 @@ int ops_sql_api_delete(struct db_url *url, struct sip_msg* msg,
940940
int ops_sql_api_replace(struct db_url *url, struct sip_msg* msg, str *table,
941941
str *cols)
942942
{
943-
cJSON *Jcols, *Jfilter;
943+
cJSON *Jcols = NULL, *Jfilter;
944944
int ret;
945945

946946
ret = _parse_json_col_and_filter( cols, NULL, &Jcols, &Jfilter);

0 commit comments

Comments
 (0)