# HG changeset patch # User cboesch # Date 1297106976 0 # Node ID a61e623885086af1174d01e3ccee291611a063bc # Parent 93629a05a38048a5abcf6386179a66a4e2196e1e Simplify frees in load_vob_subtitle. diff -r 93629a05a380 -r a61e62388508 sub/subreader.c --- a/sub/subreader.c Mon Feb 07 19:27:17 2011 +0000 +++ b/sub/subreader.c Mon Feb 07 19:29:36 2011 +0000 @@ -2161,10 +2161,8 @@ if (!name) return; strcpy_strip_ext(name, fname); - if (add_f(name, ifo, 0, spu)) { - free(name); - return; - } + if (add_f(name, ifo, 0, spu)) + goto out; // Try looking at the dirs specified by sub-paths option if (sub_paths) { @@ -2172,6 +2170,7 @@ for (i = 0; sub_paths[i]; i++) { char *path, *psub; + int sub_found; path = mp_path_join(fname, sub_paths[i]); if (!path) @@ -2182,11 +2181,10 @@ if (!psub) goto out; - if (add_f(psub, ifo, 0, spu)) { - free(psub); + sub_found = add_f(psub, ifo, 0, spu); + free(psub); + if (sub_found) goto out; - } - free(psub); } }