src/cxx_supportlib/vendor-copy/libuv/src/unix/dl.c in passenger-5.0.25 vs src/cxx_supportlib/vendor-copy/libuv/src/unix/dl.c in passenger-5.0.26
- old
+ new
@@ -37,14 +37,12 @@
return lib->handle ? 0 : uv__dlerror(lib);
}
void uv_dlclose(uv_lib_t* lib) {
- if (lib->errmsg) {
- free(lib->errmsg);
- lib->errmsg = NULL;
- }
+ uv__free(lib->errmsg);
+ lib->errmsg = NULL;
if (lib->handle) {
/* Ignore errors. No good way to signal them without leaking memory. */
dlclose(lib->handle);
lib->handle = NULL;
@@ -65,16 +63,15 @@
static int uv__dlerror(uv_lib_t* lib) {
const char* errmsg;
- if (lib->errmsg)
- free(lib->errmsg);
+ uv__free(lib->errmsg);
errmsg = dlerror();
if (errmsg) {
- lib->errmsg = strdup(errmsg);
+ lib->errmsg = uv__strdup(errmsg);
return -1;
}
else {
lib->errmsg = NULL;
return 0;