controller will pass resource <name, value> pair than <idx, value> pair

This commit is contained in:
Rongsong Shen 2026-05-13 07:18:03 +00:00
parent 9f6741c2c4
commit d47b3375e7
16 changed files with 183 additions and 86 deletions

View file

@ -385,10 +385,10 @@ int copy_strlist(xce_strlist_t* dst, xce_strlist_t src)
}
return 0;
}
void free_resval_with_idx_list(xce_val_with_idx_t*** vals, int count)
void free_name_val_list(xce_name_val_t*** vals, int count)
{
xce_val_with_idx_t** resvals = *vals;
int i;
xce_name_val_t** resvals = *vals;
int i;
if (resvals == NULL) {
return;
@ -399,18 +399,22 @@ void free_resval_with_idx_list(xce_val_with_idx_t*** vals, int count)
}
for (i = 0; i < count; i++) {
xce_val_with_idx_t* val = resvals[i];
xce_name_val_t* nv = resvals[i];
if (val == NULL) {
if (nv == NULL) {
continue;
}
if (val->val->which == Value_u_svalue) {
FREEUP(val->val->u.svalue);
FREEUP(nv->name);
if (nv->val != NULL) {
if (nv->val->which == Value_u_svalue) {
FREEUP(nv->val->u.svalue);
}
FREEUP(nv->val);
}
FREEUP(val->val);
FREEUP(val);
FREEUP(nv);
}
FREEUP(resvals);