[FFmpeg-cvslog] ffserver: break early on _parse_acl_row()

Reynaldo H. Verdejo Pinochet git at videolan.org
Sat Sep 19 01:35:29 CEST 2015


ffmpeg | branch: master | Reynaldo H. Verdejo Pinochet <reynaldo at osg.samsung.com> | Fri Sep 18 15:32:39 2015 -0700| [eb613877bf2b0af8c43b6bf6ec97398cfe825102] | committer: Reynaldo H. Verdejo Pinochet

ffserver: break early on _parse_acl_row()

Signed-off-by: Reynaldo H. Verdejo Pinochet <reynaldo at osg.samsung.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=eb613877bf2b0af8c43b6bf6ec97398cfe825102
---

 ffserver_config.c |   50 +++++++++++++++++++++++++++-----------------------
 1 file changed, 27 insertions(+), 23 deletions(-)

diff --git a/ffserver_config.c b/ffserver_config.c
index de8a454..5df871c 100644
--- a/ffserver_config.c
+++ b/ffserver_config.c
@@ -116,6 +116,8 @@ void ffserver_parse_acl_row(FFServerStream *stream, FFServerStream* feed,
 {
     char arg[1024];
     FFServerIPAddressACL acl;
+    FFServerIPAddressACL *nacl;
+    FFServerIPAddressACL **naclp;
     int errors = 0;
 
     ffserver_get_arg(arg, sizeof(arg), &p);
@@ -150,33 +152,35 @@ void ffserver_parse_acl_row(FFServerStream *stream, FFServerStream* feed,
         }
     }
 
-    if (!errors) {
-        FFServerIPAddressACL *nacl = av_mallocz(sizeof(*nacl));
-        FFServerIPAddressACL **naclp = 0;
-
-        acl.next = 0;
-        *nacl = acl;
+    if (errors)
+        return;
 
-        if (stream)
-            naclp = &stream->acl;
-        else if (feed)
-            naclp = &feed->acl;
-        else if (ext_acl)
-            naclp = &ext_acl;
-        else {
-            fprintf(stderr, "%s:%d: ACL found not in <Stream> or <Feed>\n",
-                    filename, line_num);
-            errors++;
-        }
+    nacl = av_mallocz(sizeof(*nacl));
+    naclp = 0;
 
-        if (naclp) {
-            while (*naclp)
-                naclp = &(*naclp)->next;
+    acl.next = 0;
+    *nacl = acl;
 
-            *naclp = nacl;
-        } else
-            av_free(nacl);
+    if (stream)
+        naclp = &stream->acl;
+    else if (feed)
+        naclp = &feed->acl;
+    else if (ext_acl)
+        naclp = &ext_acl;
+    else {
+        fprintf(stderr, "%s:%d: ACL found not in <Stream> or <Feed>\n",
+                filename, line_num);
+        errors++; /* FIXME: No effect whatsoever */
     }
+
+    if (naclp) {
+        while (*naclp)
+            naclp = &(*naclp)->next;
+
+        *naclp = nacl;
+    } else
+        av_free(nacl);
+
 }
 
 /* add a codec and set the default parameters */



More information about the ffmpeg-cvslog mailing list