aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefano Sabatini <stefasab@gmail.com>2012-11-16 10:58:37 +0100
committerStefano Sabatini <stefasab@gmail.com>2012-11-18 16:52:46 +0100
commit158763312f97dd1cf635114c52c550800eda83d2 (patch)
treea5719730b80bb23654a093e7147b5b973b0abe4e
parent6c7ae49330cc6a3d38286afc44e093bbe45ed1a2 (diff)
downloadffmpeg-158763312f97dd1cf635114c52c550800eda83d2.tar.gz
lavfi/frei0r: in init() check path loop, free resources in a single point
-rw-r--r--libavfilter/vf_frei0r.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/libavfilter/vf_frei0r.c b/libavfilter/vf_frei0r.c
index 9604b46147..7e89e57049 100644
--- a/libavfilter/vf_frei0r.c
+++ b/libavfilter/vf_frei0r.c
@@ -237,19 +237,21 @@ static av_cold int frei0r_init(AVFilterContext *ctx,
/* add additional trailing slash in case it is missing */
char *p1 = av_asprintf("%s/", p);
if (!p1) {
- av_free(path);
- return AVERROR(ENOMEM);
+ ret = AVERROR(ENOMEM);
+ goto check_path_end;
}
ret = load_path(ctx, &frei0r->dl_handle, p1, dl_name);
av_free(p1);
- if (ret < 0) {
- av_free(path);
- return ret;
- }
+ if (ret < 0)
+ goto check_path_end;
if (frei0r->dl_handle)
break;
}
+
+ check_path_end:
av_free(path);
+ if (ret < 0)
+ return ret;
}
if (!frei0r->dl_handle && (path = getenv("HOME"))) {
char *prefix = av_asprintf("%s/.frei0r-1/lib/", path);