77
88#include " git2.h"
99
10+ #include " ../include/functions/copy.h"
11+
1012#include " ../include/commit.h"
1113#include " ../include/oid.h"
1214#include " ../include/repo.h"
@@ -82,7 +84,8 @@ Handle<Value> GitCommit::Oid(const Arguments& args) {
8284 );
8385
8486 Handle<Value> to;
85- to = GitOid::New ((void *)result);
87+ result = (const git_oid * )git_oid_dup (result);
88+ to = GitOid::New ((void *)result);
8689 return scope.Close (to);
8790}
8891
@@ -147,7 +150,8 @@ Handle<Value> GitCommit::Committer(const Arguments& args) {
147150 );
148151
149152 Handle<Value> to;
150- to = GitSignature::New ((void *)result);
153+ result = (const git_signature * )git_signature_dup (result);
154+ to = GitSignature::New ((void *)result);
151155 return scope.Close (to);
152156}
153157
@@ -160,7 +164,8 @@ Handle<Value> GitCommit::Author(const Arguments& args) {
160164 );
161165
162166 Handle<Value> to;
163- to = GitSignature::New ((void *)result);
167+ result = (const git_signature * )git_signature_dup (result);
168+ to = GitSignature::New ((void *)result);
164169 return scope.Close (to);
165170}
166171
@@ -173,7 +178,8 @@ Handle<Value> GitCommit::TreeId(const Arguments& args) {
173178 );
174179
175180 Handle<Value> to;
176- to = GitOid::New ((void *)result);
181+ result = (const git_oid * )git_oid_dup (result);
182+ to = GitOid::New ((void *)result);
177183 return scope.Close (to);
178184}
179185
@@ -204,7 +210,8 @@ Handle<Value> GitCommit::ParentId(const Arguments& args) {
204210 );
205211
206212 Handle<Value> to;
207- to = GitOid::New ((void *)result);
213+ result = (const git_oid * )git_oid_dup (result);
214+ to = GitOid::New ((void *)result);
208215 return scope.Close (to);
209216}
210217
0 commit comments