core: fix potential memory leak

This commit is contained in:
Peter Meerwald 2011-12-19 12:28:41 +01:00 committed by Arun Raghavan
parent c3d83b17ea
commit 49fd49f21f

View file

@ -1982,8 +1982,10 @@ static char *get_path(const char *fn, pa_bool_t prependmid, pa_bool_t rt) {
if (fn) {
char *r;
if (pa_is_path_absolute(fn))
if (pa_is_path_absolute(fn)) {
pa_xfree(rtp);
return pa_xstrdup(fn);
}
if (!rtp)
return NULL;