summaryrefslogtreecommitdiffstats
path: root/stream/librtsp
diff options
context:
space:
mode:
authorcboesch <cboesch@b3059339-0415-0410-9bf9-f77b7e298cf2>2010-11-14 09:12:34 +0000
committerUoti Urpala <uau@glyph.nonexistent.invalid>2010-11-14 13:11:20 +0200
commitfe3c4810e1c8b535caf07df8e4434e322d3e6fc0 (patch)
treecbcd859f358c479223eb7b0aa2a2d3dfe1c81b69 /stream/librtsp
parentb492561241f2a3263a8ab558fafc957130dbdfc1 (diff)
downloadmpv-fe3c4810e1c8b535caf07df8e4434e322d3e6fc0.tar.bz2
mpv-fe3c4810e1c8b535caf07df8e4434e322d3e6fc0.tar.xz
cleanup: remove NULL checks before free() all over the code
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32624 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'stream/librtsp')
-rw-r--r--stream/librtsp/rtsp.c6
-rw-r--r--stream/librtsp/rtsp_rtp.c3
-rw-r--r--stream/librtsp/rtsp_session.c10
3 files changed, 9 insertions, 10 deletions
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);