Skip to content

Commit

Permalink
Merge pull request #38839 from JuliaLang/jn/38838
Browse files Browse the repository at this point in the history
win: skip bad paths in dllist
  • Loading branch information
vchuravy authored Dec 14, 2020
2 parents e65515e + a6f0e69 commit 8d80154
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/sys.c
Original file line number Diff line number Diff line change
Expand Up @@ -600,10 +600,13 @@ JL_DLLEXPORT int jl_dllist(jl_array_t *list)
}
} while (cb < cbNeeded);
for (i = 0; i < cbNeeded / sizeof(HMODULE); i++) {
jl_array_grow_end((jl_array_t*)list, 1);
const char *path = jl_pathname_for_handle(hMods[i]);
// XXX: change to jl_arrayset if array storage allocation for Array{String,1} changes:
if (path == NULL)
continue;
jl_array_grow_end((jl_array_t*)list, 1);
jl_value_t *v = jl_cstr_to_string(path);
free(path);
jl_array_ptr_set(list, jl_array_dim0(list) - 1, v);
}
free(hMods);
Expand Down

0 comments on commit 8d80154

Please sign in to comment.