diff options
author | Colin Watson <cjwatson@debian.org> | 2009-06-21 02:01:35 +0100 |
---|---|---|
committer | Colin Watson <cjwatson@debian.org> | 2009-06-21 02:01:35 +0100 |
commit | 19fa692334f10cdac30c7e5888fde76b9a5eca7d (patch) | |
tree | 05c7ec0bc0567dc7bc57a735378126754ee5903e /src | |
parent | 9dcfeef057c40b8c93299348a87dfc8ae7cde78b (diff) |
* src/ult_src.c (ult_src): Keep a copy of base before passing it to
decompress_open, as that function doesn'\''t keep its own copy and we
may change base later.
Diffstat (limited to 'src')
-rw-r--r-- | src/ult_src.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/ult_src.c b/src/ult_src.c index 5517d421..e48f444e 100644 --- a/src/ult_src.c +++ b/src/ult_src.c @@ -260,6 +260,7 @@ const char *ult_src (const char *name, const char *path, if (flags & SO_LINK) { const char *buffer; + char *decomp_base; pipeline *decomp; #ifdef COMP_SRC struct stat st; @@ -281,10 +282,15 @@ const char *ult_src (const char *name, const char *path, } #endif - decomp = decompress_open (base); + /* base may change for recursive calls to ult_src, but + * decompress_open doesn't keep its own copy. + */ + decomp_base = xstrdup (base); + decomp = decompress_open (decomp_base); if (!decomp) { if (quiet < 2) error (0, errno, _("can't open %s"), base); + free (decomp_base); return NULL; } pipeline_start (decomp); @@ -316,12 +322,14 @@ const char *ult_src (const char *name, const char *path, pipeline_wait (decomp); pipeline_free (decomp); + free (decomp_base); return ult; } } pipeline_wait (decomp); pipeline_free (decomp); + free (decomp_base); } /* We have the ultimate source */ |