From f37507a707e53e51b96723f04c2c026f7dc80ed6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20=27Flameeyes=27=20Petten=C3=B2?= Date: Tue, 26 Sep 2006 22:18:44 +0000 Subject: Free the _data pointer when returning NULL. Fix backported from upstream. Closes Coverity Scan CID 225. CVS patchset: 8309 CVS date: 2006/09/26 22:18:44 --- src/input/vcd/libcdio/_cdio_linux.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/input/vcd/libcdio/_cdio_linux.c b/src/input/vcd/libcdio/_cdio_linux.c index 86a34133f..ea70d262c 100644 --- a/src/input/vcd/libcdio/_cdio_linux.c +++ b/src/input/vcd/libcdio/_cdio_linux.c @@ -1,5 +1,5 @@ /* - $Id: _cdio_linux.c,v 1.3 2005/01/01 02:43:57 rockyb Exp $ + $Id: _cdio_linux.c,v 1.4 2006/09/26 22:18:44 dgp85 Exp $ Copyright (C) 2001 Herbert Valerio Riedel Copyright (C) 2002, 2003, 2004 Rocky Bernstein @@ -27,7 +27,7 @@ # include "config.h" #endif -static const char _rcsid[] = "$Id: _cdio_linux.c,v 1.3 2005/01/01 02:43:57 rockyb Exp $"; +static const char _rcsid[] = "$Id: _cdio_linux.c,v 1.4 2006/09/26 22:18:44 dgp85 Exp $"; #include @@ -1151,7 +1151,10 @@ cdio_open_am_linux (const char *psz_orig_source, const char *access_mode) if (NULL == psz_orig_source) { psz_source=cdio_get_default_device_linux(); - if (NULL == psz_source) return NULL; + if (NULL == psz_source) { + free(_data); + return NULL; + } set_arg_linux(_data, "source", psz_source); free(psz_source); } else { @@ -1162,6 +1165,7 @@ cdio_open_am_linux (const char *psz_orig_source, const char *access_mode) #if 0 cdio_info ("source %s is not a device", psz_orig_source); #endif + free(_data); return NULL; } } -- cgit v1.2.3