aboutsummaryrefslogtreecommitdiff
path: root/loader/loader.c
diff options
context:
space:
mode:
authorCourtney Goeltzenleuchter <courtneygo@google.com>2015-12-09 12:26:34 -0700
committerJon Ashburn <jon@lunarg.com>2015-12-17 11:20:07 -0700
commitb1c118f19f066052cc5e53ed6770777e01dd1aab (patch)
tree2e64ae64b394f0f15b729a3c175ecbb24c55a3bf /loader/loader.c
parent43b34d53611f139021c063fe2fa098f30bdbb6cb (diff)
downloadusermoji-b1c118f19f066052cc5e53ed6770777e01dd1aab.tar.xz
loader: save memory pointer before it's lost
The first time a library is loaded the code will allocate space for the list. But if the dlopen fails the pointer for that wasn't being saved and the next call would get a segfault on a null pointer. Now save the new pointer so it doesn't get lost.
Diffstat (limited to 'loader/loader.c')
-rw-r--r--loader/loader.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/loader/loader.c b/loader/loader.c
index 2699c0c7..e3609b85 100644
--- a/loader/loader.c
+++ b/loader/loader.c
@@ -2549,6 +2549,7 @@ static loader_platform_dl_handle loader_add_layer_lib(
return NULL;
}
loader.loaded_layer_lib_capacity = new_alloc_size;
+ loader.loaded_layer_lib_list = new_layer_lib_list;
} else
new_layer_lib_list = loader.loaded_layer_lib_list;
my_lib = &new_layer_lib_list[loader.loaded_layer_lib_count];
@@ -2568,7 +2569,6 @@ static loader_platform_dl_handle loader_add_layer_lib(
chain_type, layer_prop->lib_name);
}
loader.loaded_layer_lib_count++;
- loader.loaded_layer_lib_list = new_layer_lib_list;
my_lib->ref_count++;
return my_lib->lib_handle;