File tree Expand file tree Collapse file tree 4 files changed +9
-2
lines changed
Expand file tree Collapse file tree 4 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -112,6 +112,7 @@ Handle<Value> GitOid::Sha(const Arguments& args) {
112112
113113 Handle<Value> to;
114114 to = String::New (result);
115+ free (result);
115116 return scope.Close (to);
116117}
117118
Original file line number Diff line number Diff line change @@ -319,6 +319,7 @@ Handle<Value> GitPatch::ToString(const Arguments& args) {
319319
320320 Handle<Value> to;
321321 to = String::New (string);
322+ free (string);
322323 return scope.Close (to);
323324}
324325
Original file line number Diff line number Diff line change 55< % } else { -% >
66 to = String :: New (< %- toName % > );
77< % } -% >
8+ < % if (to .freeFunctionName ) { -% >
9+ < %- to .freeFunctionName % > (< %- toName % > );
10+ < % } -% >
811< % } else if (isV8Value (to .cppClassName )) { -% >
912 to = < %- to .cppClassName % > :: New (< %- toName % > );
1013< % } else if (to .cppClassName == " External" ) { -% >
Original file line number Diff line number Diff line change 31473147 "cppClassName": "String",
31483148 "jsClassName": "String",
31493149 "isReturn": true,
3150- "comment": "Allocated string; caller must free."
3150+ "comment": "Allocated string; caller must free.",
3151+ "freeFunctionName": "free"
31513152 },
31523153 {
31533154 "name": "patch",
76227623 "cType": "char *",
76237624 "cppClassName": "String",
76247625 "comment": "the c-string; NULL if memory is exhausted. Caller must deallocate the string with git__free().",
7625- "jsClassName": "String"
7626+ "jsClassName": "String",
7627+ "freeFunctionName": "free"
76267628 },
76277629 "description": "<p>Format a git_oid into a newly allocated c-string.</p>\n"
76287630 },
You can’t perform that action at this time.
0 commit comments