Browse Source

make the uci_ptr struct reusable after a call to uci_delete()

Felix Fietkau 15 years ago
parent
commit
00d91c8ca4
1 changed files with 6 additions and 0 deletions
  1. 6 0
      list.c

+ 6 - 0
list.c

@@ -567,6 +567,12 @@ int uci_delete(struct uci_context *ctx, struct uci_ptr *ptr)
 		uci_add_history(ctx, &p->history, UCI_CMD_REMOVE, ptr->section, ptr->option, NULL);
 
 	uci_free_any(&e);
+
+	if (ptr->option)
+		ptr->o = NULL;
+	else if (ptr->section)
+		ptr->s = NULL;
+
 	return 0;
 }