Skip to content

Commit 1a74a2d

Browse files
committed
Allocate the correct amount of memory
1 parent 22430ec commit 1a74a2d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

generate/templates/manual/src/str_array_converter.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ git_strarray *StrArrayConverter::Convert(Handle<v8::Value> val) {
2525
}
2626

2727
git_strarray *StrArrayConverter::ConvertArray(Array *val) {
28-
git_strarray *result = (git_strarray *)malloc(sizeof(git_strarray*));
28+
git_strarray *result = (git_strarray *)malloc(sizeof(git_strarray));
2929
result->count = val->Length();
3030
result->strings = (char **)malloc(sizeof(char*) * result->count);
3131

@@ -47,7 +47,7 @@ git_strarray* StrArrayConverter::ConvertString(Handle<String> val) {
4747
}
4848

4949
git_strarray *StrArrayConverter::ConstructStrArray(int argc, char** argv) {
50-
git_strarray *result = (git_strarray *)malloc(sizeof(git_strarray*));
50+
git_strarray *result = (git_strarray *)malloc(sizeof(git_strarray));
5151
result->count = argc;
5252
result->strings = (char **)malloc(sizeof(char*) * result->count);
5353

0 commit comments

Comments
 (0)