projects
/
haproxy-2.5.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
147b8c9
)
MINOR: hlua: Add function to release a lua function
author
Christopher Faulet
<cfaulet@haproxy.com>
Mon, 12 Apr 2021 12:05:43 +0000
(14:05 +0200)
committer
Christopher Faulet
<cfaulet@haproxy.com>
Mon, 12 Apr 2021 13:46:53 +0000
(15:46 +0200)
release_hlua_function() must be used to release a lua function. Some fixes
depends on this function.
src/hlua.c
patch
|
blob
|
history
diff --git
a/src/hlua.c
b/src/hlua.c
index
fb4e2b2
..
c147fc3
100644
(file)
--- a/
src/hlua.c
+++ b/
src/hlua.c
@@
-318,6
+318,16
@@
static inline struct hlua_function *new_hlua_function()
return fcn;
}
+static inline void release_hlua_function(struct hlua_function *fcn)
+{
+ if (!fcn)
+ return;
+ if (fcn->name)
+ ha_free(&fcn->name);
+ LIST_DEL(&fcn->l);
+ ha_free(&fcn);
+}
+
/* If the common state is set, the stack id is 0, otherwise it is the tid + 1 */
static inline int fcn_ref_to_stack_id(struct hlua_function *fcn)
{