mirror of
https://gitlab.com/openconnect/ocserv.git
synced 2026-10-12 01:26:48 +08:00
str: explicitly deinitialize temporary value, instead of relying on talloc
This commit is contained in:
@@ -186,8 +186,11 @@ int str_replace_str(str_st *str, const str_rep_tab *tab)
|
||||
str->length -= final_len + ptab->pattern_length;
|
||||
if (ptab->rep_val)
|
||||
ret = str_append_str(str, ptab->rep_val);
|
||||
else
|
||||
ret = str_append_str(str, ptab->rep_func(str->pool, ptab->rep_func_input));
|
||||
else {
|
||||
char *t = ptab->rep_func(str->pool, ptab->rep_func_input);
|
||||
ret = str_append_str(str, t);
|
||||
talloc_free(t);
|
||||
}
|
||||
if (ret < 0) {
|
||||
talloc_free(final);
|
||||
return ret;
|
||||
|
||||
Reference in New Issue
Block a user