summaryrefslogtreecommitdiffstats
path: root/stream
diff options
context:
space:
mode:
Diffstat (limited to 'stream')
-rw-r--r--stream/freesdp/parser.c6
-rw-r--r--stream/librtsp/rtsp.c6
-rw-r--r--stream/librtsp/rtsp_rtp.c3
-rw-r--r--stream/librtsp/rtsp_session.c10
-rw-r--r--stream/realrtsp/real.c3
-rw-r--r--stream/realrtsp/rmff.c6
-rw-r--r--stream/realrtsp/sdpplin.c24
7 files changed, 23 insertions, 35 deletions
diff --git a/stream/freesdp/parser.c b/stream/freesdp/parser.c
index 6d806a6e80..0774ce84f8 100644
--- a/stream/freesdp/parser.c
+++ b/stream/freesdp/parser.c
@@ -471,8 +471,7 @@ fsdp_parse (const char *text_description, fsdp_description_t * dsc)
}
else if (!strncmp (fsdp_buf[0], "range", 5))
{
- if (dsc->a_range)
- free (dsc->a_range);
+ free (dsc->a_range);
dsc->a_range = strdup (fsdp_buf[1]);
}
else
@@ -770,8 +769,7 @@ fsdp_parse (const char *text_description, fsdp_description_t * dsc)
}
else if (!strncmp (fsdp_buf[0], "range", 5))
{
- if (media->a_range)
- free (media->a_range);
+ free (media->a_range);
media->a_range = strdup (fsdp_buf[1]);
}
else if (!strncmp (fsdp_buf[0], "framerate", 9))
diff --git a/stream/librtsp/rtsp.c b/stream/librtsp/rtsp.c
index 82669616ac..e02ae4c72b 100644
--- a/stream/librtsp/rtsp.c
+++ b/stream/librtsp/rtsp.c
@@ -291,7 +291,7 @@ static int rtsp_get_answers(rtsp_t *s) {
if (!strncasecmp(answer,"Server:",7)) {
char *buf = malloc(strlen(answer));
sscanf(answer,"%*s %s",buf);
- if (s->server) free(s->server);
+ free(s->server);
s->server=strdup(buf);
free(buf);
}
@@ -612,7 +612,7 @@ char *rtsp_search_answers(rtsp_t *s, const char *tag) {
void rtsp_set_session(rtsp_t *s, const char *id) {
- if (s->session) free(s->session);
+ free(s->session);
s->session=strdup(id);
@@ -686,7 +686,7 @@ void rtsp_unschedule_field(rtsp_t *s, const char *string) {
else
ptr++;
}
- if (*ptr) free(*ptr);
+ free(*ptr);
ptr++;
do {
*(ptr-1)=*ptr;
diff --git a/stream/librtsp/rtsp_rtp.c b/stream/librtsp/rtsp_rtp.c
index b0c36a9eeb..ca82209252 100644
--- a/stream/librtsp/rtsp_rtp.c
+++ b/stream/librtsp/rtsp_rtp.c
@@ -131,8 +131,7 @@ rtp_session_free (struct rtp_rtsp_session_t *st)
if (st->rtcp_socket != -1)
close (st->rtcp_socket);
- if (st->control_url)
- free (st->control_url);
+ free (st->control_url);
free (st);
}
diff --git a/stream/librtsp/rtsp_session.c b/stream/librtsp/rtsp_session.c
index b1176dbb99..625727288c 100644
--- a/stream/librtsp/rtsp_session.c
+++ b/stream/librtsp/rtsp_session.c
@@ -89,11 +89,11 @@ static void rtsp_close(rtsp_t *s) {
closesocket (s->s);
}
- if (s->path) free(s->path);
- if (s->host) free(s->host);
- if (s->mrl) free(s->mrl);
- if (s->session) free(s->session);
- if (s->user_agent) free(s->user_agent);
+ free(s->path);
+ free(s->host);
+ free(s->mrl);
+ free(s->session);
+ free(s->user_agent);
free(s->server);
rtsp_free_answers(s);
rtsp_unschedule_all(s);
diff --git a/stream/realrtsp/real.c b/stream/realrtsp/real.c
index cad231dedd..6f33bc9c6c 100644
--- a/stream/realrtsp/real.c
+++ b/stream/realrtsp/real.c
@@ -507,8 +507,7 @@ rtsp_send_describe:
}
autherr:
- if (authfield)
- free(authfield);
+ free(authfield);
if ( status<200 || status>299 )
{
diff --git a/stream/realrtsp/rmff.c b/stream/realrtsp/rmff.c
index e147b76f36..d538222141 100644
--- a/stream/realrtsp/rmff.c
+++ b/stream/realrtsp/rmff.c
@@ -847,9 +847,9 @@ void rmff_free_header(rmff_header_t *h) {
if (!h) return;
- if (h->fileheader) free(h->fileheader);
- if (h->prop) free(h->prop);
- if (h->data) free(h->data);
+ free(h->fileheader);
+ free(h->prop);
+ free(h->data);
if (h->cont)
{
free(h->cont->title);
diff --git a/stream/realrtsp/sdpplin.c b/stream/realrtsp/sdpplin.c
index fe561f4082..41ef618d25 100644
--- a/stream/realrtsp/sdpplin.c
+++ b/stream/realrtsp/sdpplin.c
@@ -368,14 +368,10 @@ void sdpplin_free(sdpplin_t *description) {
for (i = 0; i < description->stream_count; i++) {
if (description->stream[i]) {
- if (description->stream[i]->stream_name)
- free(description->stream[i]->stream_name);
- if (description->stream[i]->mime_type)
- free(description->stream[i]->mime_type);
- if (description->stream[i]->mlti_data)
- free(description->stream[i]->mlti_data);
- if (description->stream[i]->asm_rule_book)
- free(description->stream[i]->asm_rule_book);
+ free(description->stream[i]->stream_name);
+ free(description->stream[i]->mime_type);
+ free(description->stream[i]->mlti_data);
+ free(description->stream[i]->asm_rule_book);
free(description->stream[i]->id);
free(description->stream[i]);
}
@@ -383,14 +379,10 @@ void sdpplin_free(sdpplin_t *description) {
if(description->stream_count)
free(description->stream);
- if (description->title)
- free(description->title);
- if (description->author)
- free(description->author);
- if (description->copyright)
- free(description->copyright);
- if (description->abstract)
- free(description->abstract);
+ free(description->title);
+ free(description->author);
+ free(description->copyright);
+ free(description->abstract);
free(description);
}