commit ba5fd6b

uint  ·  2026-10-24 19:18:21 +0000 UTC
parent 5db097c
Dont leak f if above check fails
1 files changed,  +2, -1
M expl.c
M expl.c
+2, -1
 1@@ -503,12 +503,13 @@ void expl_close(expl* ctx)
 2 int
 3 expl_register(expl* ctx, const char* name, expl_native fn, void* data)
 4 {
 5-	function* f = calloc(1, sizeof(*f));
 6+	function* f = NULL;
 7 	expl_value value = { 0 };
 8 
 9 	if (!f || !ctx || !name || !fn)
10 		return 0;
11 
12+	f = calloc(1, sizeof(*f));
13 	f->native = fn;
14 	f->data = data;
15