Skip to content

Commit

Permalink
Correctly initialize some objects
Browse files Browse the repository at this point in the history
  • Loading branch information
CannibalVox committed Apr 11, 2020
1 parent 97dbaf1 commit 756dd57
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions go_callbacks.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@ int execute_go_callback(lua_State *_L) {

lua_return *goReturn = chmalloc(sizeof(lua_return));
goReturn->valueCount = 0;
goReturn->values = NULL;

lua_err *retErr = chmalloc(sizeof(lua_error));
retErr->message = NULL;

goReturn->err = retErr;
callbackGoFunction(_L, *goCallback, args, goReturn);
free_temporary_lua_args(_L, args, 1);
Expand Down
2 changes: 2 additions & 0 deletions go_luatypes.c
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,8 @@ lua_err *push_lua_return(lua_State *_L, lua_return retVal) {

lua_unrolled_table *build_unrolled_table(int entries) {
lua_unrolled_table *table = chmalloc(sizeof(lua_unrolled_table));
table->first = NULL;
table->last = NULL;

lua_table_entry *entry = NULL;
for (int i = 0; i < entries; i++) {
Expand Down

0 comments on commit 756dd57

Please sign in to comment.