commit c57829 introduced a memory leak by passing the path string to
strsep. strsep will change the given pointer and set it to NULL eventually.
Causing the original pointer to leak. Fix by passing a copy of the pointer
to strsep.
Signed-off-by: Mark Wielaard <mjw@redhat.com>
+2015-06-01 Mark Wielaard <mjw@redhat.com>
+
+ * dwfl_build_id_find_elf.c (__libdwfl_open_by_build_id): Copy path
+ pointer before passing to strsep.
+
2015-05-30 Mark Wielaard <mjw@redhat.com>
* link_map.c (check32): Use read_4ubyte_unaligned_noncvt to read
int fd = -1;
char *dir;
- while (fd < 0 && (dir = strsep (&path, ":")) != NULL)
+ char *paths = path;
+ while (fd < 0 && (dir = strsep (&paths, ":")) != NULL)
{
if (dir[0] == '+' || dir[0] == '-')
++dir;