diff mbox

[FFmpeg-devel,1/2] lavf/http.c: Free allocated client URLContext in case of error.

Message ID 20170411180502.12739-1-klaxa1337@googlemail.com
State Superseded
Headers show

Commit Message

Stephan Holljes April 11, 2017, 6:05 p.m. UTC
---

This version returns 0 in case of success and does not fallthrough to fail:.

 libavformat/http.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Stephan Holljes April 22, 2017, 1:18 a.m. UTC | #1
On Tue, Apr 11, 2017 at 8:05 PM, Stephan Holljes
<klaxa1337@googlemail.com> wrote:
> ---
>
> This version returns 0 in case of success and does not fallthrough to fail:.
>
>  libavformat/http.c | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/libavformat/http.c b/libavformat/http.c
> index 293a8a7..2917b6e 100644
> --- a/libavformat/http.c
> +++ b/libavformat/http.c
> @@ -535,7 +535,11 @@ static int http_accept(URLContext *s, URLContext **c)
>          goto fail;
>      cc->hd = cl;
>      cc->is_multi_client = 1;
> +    return 0;
>  fail:
> +    if (c) {
> +        ffurl_close(*c);
> +    }
>      return ret;
>  }
>
> --
> 2.9.3
>

Friendly ping :)
Stephan Holljes May 20, 2017, 12:50 a.m. UTC | #2
On Sat, Apr 22, 2017 at 3:18 AM, Stephan Holljes
<klaxa1337@googlemail.com> wrote:
> On Tue, Apr 11, 2017 at 8:05 PM, Stephan Holljes
> <klaxa1337@googlemail.com> wrote:
>> ---
>>
>> This version returns 0 in case of success and does not fallthrough to fail:.
>>
>>  libavformat/http.c | 4 ++++
>>  1 file changed, 4 insertions(+)
>>
>> diff --git a/libavformat/http.c b/libavformat/http.c
>> index 293a8a7..2917b6e 100644
>> --- a/libavformat/http.c
>> +++ b/libavformat/http.c
>> @@ -535,7 +535,11 @@ static int http_accept(URLContext *s, URLContext **c)
>>          goto fail;
>>      cc->hd = cl;
>>      cc->is_multi_client = 1;
>> +    return 0;
>>  fail:
>> +    if (c) {
>> +        ffurl_close(*c);
>> +    }
>>      return ret;
>>  }
>>
>> --
>> 2.9.3
>>
>
> Friendly ping :)

Ping.
Stephan Holljes Jan. 10, 2018, 2:55 a.m. UTC | #3
On Sat, May 20, 2017 at 2:50 AM, Stephan Holljes
<klaxa1337@googlemail.com> wrote:
> On Sat, Apr 22, 2017 at 3:18 AM, Stephan Holljes
> <klaxa1337@googlemail.com> wrote:
>> On Tue, Apr 11, 2017 at 8:05 PM, Stephan Holljes
>> <klaxa1337@googlemail.com> wrote:
>>> ---
>>>
>>> This version returns 0 in case of success and does not fallthrough to fail:.
>>>
>>>  libavformat/http.c | 4 ++++
>>>  1 file changed, 4 insertions(+)
>>>
>>> diff --git a/libavformat/http.c b/libavformat/http.c
>>> index 293a8a7..2917b6e 100644
>>> --- a/libavformat/http.c
>>> +++ b/libavformat/http.c
>>> @@ -535,7 +535,11 @@ static int http_accept(URLContext *s, URLContext **c)
>>>          goto fail;
>>>      cc->hd = cl;
>>>      cc->is_multi_client = 1;
>>> +    return 0;
>>>  fail:
>>> +    if (c) {
>>> +        ffurl_close(*c);
>>> +    }
>>>      return ret;
>>>  }
>>>
>>> --
>>> 2.9.3
>>>
>>
>> Friendly ping :)
>
> Ping.

These patches still seem to apply, ping :)
diff mbox

Patch

diff --git a/libavformat/http.c b/libavformat/http.c
index 293a8a7..2917b6e 100644
--- a/libavformat/http.c
+++ b/libavformat/http.c
@@ -535,7 +535,11 @@  static int http_accept(URLContext *s, URLContext **c)
         goto fail;
     cc->hd = cl;
     cc->is_multi_client = 1;
+    return 0;
 fail:
+    if (c) {
+        ffurl_close(*c);
+    }
     return ret;
 }