ffserver: break early on _parse_acl_row()

Signed-off-by: 's avatarReynaldo H. Verdejo Pinochet <reynaldo@osg.samsung.com>
parent c677b42f
...@@ -116,6 +116,8 @@ void ffserver_parse_acl_row(FFServerStream *stream, FFServerStream* feed, ...@@ -116,6 +116,8 @@ void ffserver_parse_acl_row(FFServerStream *stream, FFServerStream* feed,
{ {
char arg[1024]; char arg[1024];
FFServerIPAddressACL acl; FFServerIPAddressACL acl;
FFServerIPAddressACL *nacl;
FFServerIPAddressACL **naclp;
int errors = 0; int errors = 0;
ffserver_get_arg(arg, sizeof(arg), &p); ffserver_get_arg(arg, sizeof(arg), &p);
...@@ -150,33 +152,35 @@ void ffserver_parse_acl_row(FFServerStream *stream, FFServerStream* feed, ...@@ -150,33 +152,35 @@ void ffserver_parse_acl_row(FFServerStream *stream, FFServerStream* feed,
} }
} }
if (!errors) { if (errors)
FFServerIPAddressACL *nacl = av_mallocz(sizeof(*nacl)); return;
FFServerIPAddressACL **naclp = 0;
acl.next = 0;
*nacl = acl;
if (stream) nacl = av_mallocz(sizeof(*nacl));
naclp = &stream->acl; naclp = 0;
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++;
}
if (naclp) { acl.next = 0;
while (*naclp) *nacl = acl;
naclp = &(*naclp)->next;
*naclp = nacl; if (stream)
} else naclp = &stream->acl;
av_free(nacl); 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 */ /* add a codec and set the default parameters */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment