Skip to content

Commit

Permalink
Fix memory leak in jl_uv_dlopen
Browse files Browse the repository at this point in the history
  • Loading branch information
garrison committed Apr 14, 2015
1 parent 78ac8a0 commit 11a0f43
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/dlload.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,14 @@ DLLEXPORT int jl_uv_dlopen(const char *filename, jl_uv_libhandle lib_, unsigned
#endif
);
if (lib->handle) {
if (lib->errmsg)
free(lib->errmsg);
lib->errmsg = NULL;
return 0;
}
else {
if (lib->errmsg)
free(lib->errmsg);
lib->errmsg = strdup(dlerror());
return -1;
}
Expand Down

0 comments on commit 11a0f43

Please sign in to comment.