diff options
Diffstat (limited to 'elf/dl-load.c')
-rw-r--r-- | elf/dl-load.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/elf/dl-load.c b/elf/dl-load.c index 0b752676b7..91b8c2a48d 100644 --- a/elf/dl-load.c +++ b/elf/dl-load.c @@ -420,7 +420,7 @@ _dl_init_paths (void) if (_dl_platform != NULL) { - char *tmp; + char *tmp, *orig; relem->machdirnamelen = relem->dirnamelen + _dl_platformlen + 1; tmp = (char *) malloc (relem->machdirnamelen + 1); @@ -428,11 +428,12 @@ _dl_init_paths (void) _dl_signal_error (ENOMEM, NULL, "cannot create cache for search path"); - relem->dirname = tmp; + orig = tmp; tmp = __mempcpy (tmp, relem->dirname, relem->dirnamelen); tmp = __mempcpy (tmp, _dl_platform, _dl_platformlen); *tmp++ = '/'; *tmp = '\0'; + relem->dirname = orig; relem->machdirstatus = unknown; |