File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
generate/templates/partials Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 58
58
if (arrayVal->IsString ()) {
59
59
// Try and parse in a string to a git_oid
60
60
Nan::Utf8String oidString (Nan::To<v8::String>(arrayVal).ToLocalChecked ());
61
-
62
- if (git_oid_fromstr (&from_{{ name }}[i], ( const char *) strdup (*oidString )) != GIT_OK) {
61
+ string str = string (*oidString);
62
+ if (git_oid_fromstr (&from_{{ name }}[i], str. c_str ( )) != GIT_OK) {
63
63
if (git_error_last ()) {
64
64
return Nan::ThrowError (git_error_last ()->message );
65
65
} else {
90
90
// Try and parse in a string to a git_oid
91
91
Nan::Utf8String oidString (Nan::To<v8::String>(info[{{ jsArg }}]).ToLocalChecked ());
92
92
git_oid *oidOut = (git_oid *)malloc (sizeof (git_oid));
93
-
94
- if (git_oid_fromstr (oidOut, ( const char *) strdup (*oidString )) != GIT_OK) {
93
+ string str = string (*oidString);
94
+ if (git_oid_fromstr (oidOut, str. c_str ( )) != GIT_OK) {
95
95
free (oidOut);
96
96
97
97
if (git_error_last ()) {
You can’t perform that action at this time.
0 commit comments