Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c8afbe6

Browse files
Fix leak freeing array from javascript
1 parent 06b04c7 commit c8afbe6

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

generate/templates/partials/async_function.cc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -182,15 +182,15 @@ void {{ cppClassName }}::{{ cppFunctionName }}Worker::Execute() {
182182
{%each args|argsInfo as arg %}
183183
{%if not arg.isSelf %}
184184
{%if not arg.payloadFor %}
185-
{%if arg.cppClassName == 'GitStrarray' %}
186-
{%if not arg.isReturn %}
185+
{%if not arg.isReturn %}
186+
{%if arg.cppClassName == 'GitStrarray' %}
187187
{{ arg.freeFunctionName }}((git_strarray*)baton->{{ arg.name }});
188188
free((void*)baton->{{ arg.name }});
189-
{%endif%}
190-
{%elsif not arg.isCallbackFunction %}
191-
{%if not arg.isStructType %}
189+
{%elsif arg.cppClassName == 'Array' %}
190+
free((void*)baton->{{ arg.name }});
191+
{%elsif not arg.isCallbackFunction %}
192192
{%if not arg.isStructType %}
193-
{%if not arg.isReturn %}
193+
{%if not arg.isStructType %}
194194
{%if not arg.isPayload %}
195195
{%if arg.name %}
196196
{%if arg.cppClassName == 'String'%}

0 commit comments

Comments
 (0)