mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2026-02-12 16:10:54 +00:00
libsysprof: avoid an extra string copy
This commit is contained in:
@ -252,7 +252,8 @@ access_path_from_container (const char *path)
|
|||||||
{
|
{
|
||||||
if ((in_flatpak && !g_str_has_prefix (path, "/home/")) || in_podman)
|
if ((in_flatpak && !g_str_has_prefix (path, "/home/")) || in_podman)
|
||||||
return g_build_filename ("/var/run/host", path, NULL);
|
return g_build_filename ("/var/run/host", path, NULL);
|
||||||
return g_strdup (path);
|
|
||||||
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static SysprofElf *
|
static SysprofElf *
|
||||||
@ -478,7 +479,10 @@ sysprof_elf_loader_load (SysprofElfLoader *self,
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (in_flatpak || in_podman)
|
if (in_flatpak || in_podman)
|
||||||
path = container_path = access_path_from_container (path);
|
{
|
||||||
|
if ((container_path = access_path_from_container (path)))
|
||||||
|
path = container_path;
|
||||||
|
}
|
||||||
|
|
||||||
/* Lookup to see if we've already parsed this ELF and handle cases where
|
/* Lookup to see if we've already parsed this ELF and handle cases where
|
||||||
* we've failed to load it too. In the case we failed to load a key is
|
* we've failed to load it too. In the case we failed to load a key is
|
||||||
|
|||||||
Reference in New Issue
Block a user