From 441d99cbf311a126779d33bf4b09119456c988a2 Mon Sep 17 00:00:00 2001 From: Thibaut Mattern Date: Sat, 18 Mar 2006 09:42:43 +0000 Subject: [coverity] CID: 103 Checker: NULL_RETURNS (help) File: xine-lib/src/input/librtsp/rtsp.c Function: rtsp_search_answers Description: Incrementing possibly NULL value "ptr" CID: 179 Checker: RESOURCE_LEAK (help) File: xine-lib/src/input/librtsp/rtsp.c Function: rtsp_read_data Description: Variable "rest" not freed or pointed-to in function "rtsp_put" CVS patchset: 7939 CVS date: 2006/03/18 09:42:43 --- src/input/librtsp/rtsp.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/input/librtsp/rtsp.c b/src/input/librtsp/rtsp.c index d3221c463..9c3dbb125 100644 --- a/src/input/librtsp/rtsp.c +++ b/src/input/librtsp/rtsp.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: rtsp.c,v 1.19 2005/04/16 07:10:51 tmmm Exp $ + * $Id: rtsp.c,v 1.20 2006/03/18 09:42:43 tmattern Exp $ * * a minimalistic implementation of rtsp protocol, * *not* RFC 2326 compilant yet. @@ -417,6 +417,7 @@ int rtsp_read_data(rtsp_t *s, char *buffer, unsigned int size) { rest = malloc(sizeof(char)*17); sprintf(rest,"CSeq: %u", seq); rtsp_put(s, rest); + free(rest); rtsp_put(s, ""); i=_x_io_tcp_read(s->stream, s->s, buffer, size); } else @@ -561,6 +562,7 @@ char *rtsp_search_answers(rtsp_t *s, const char *tag) { while (*answer) { if (!strncasecmp(*answer,tag,strlen(tag))) { ptr=strchr(*answer,':'); + if (!ptr) return NULL; ptr++; while(*ptr==' ') ptr++; return ptr; -- cgit v1.2.3