projects
/
project
/
libubox.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
uloop: Do not override signal handlers not installed by us
[project/libubox.git]
/
json_script.c
diff --git
a/json_script.c
b/json_script.c
index 9d5e9d2bf5a4287149e00284fc8924e01ac11978..0ec7b382ad94d4bbdb64156210243513af9daf30 100644
(file)
--- a/
json_script.c
+++ b/
json_script.c
@@
-582,12
+582,18
@@
void json_script_run(struct json_script_ctx *ctx, const char *name,
json_script_run_file(ctx, file, vars);
}
json_script_run_file(ctx, file, vars);
}
-static void __json_script_file_free(struct json_script_
ctx *ctx, struct json_script_
file *f)
+static void __json_script_file_free(struct json_script_file *f)
{
struct json_script_file *next;
{
struct json_script_file *next;
- for (next = f->next; f; f = next, next = f->next)
- free(f);
+ if (!f)
+ return;
+
+ next = f->next;
+ free(f);
+
+ if (next)
+ return __json_script_file_free(next);
}
void
}
void
@@
-596,7
+602,7
@@
json_script_free(struct json_script_ctx *ctx)
struct json_script_file *f, *next;
avl_remove_all_elements(&ctx->files, f, avl, next)
struct json_script_file *f, *next;
avl_remove_all_elements(&ctx->files, f, avl, next)
- __json_script_file_free(
ctx,
f);
+ __json_script_file_free(f);
blob_buf_free(&ctx->buf);
}
blob_buf_free(&ctx->buf);
}