summaryrefslogtreecommitdiffstats
path: root/stream
diff options
context:
space:
mode:
authorUoti Urpala <uau@mplayer2.org>2012-01-16 22:33:52 +0200
committerUoti Urpala <uau@mplayer2.org>2012-01-16 22:40:14 +0200
commit6c57eeb7ad496afd1fd74b1133542e40e86b0875 (patch)
tree49a80972c2ab2e6770e8cd0c06118d110477b54b /stream
parent668654098ede4f4801fc7bc2b2bec4070902a4fd (diff)
downloadmpv-6c57eeb7ad496afd1fd74b1133542e40e86b0875.tar.bz2
mpv-6c57eeb7ad496afd1fd74b1133542e40e86b0875.tar.xz
stream_vcd: fix option value allocated with strdup
A string freed with m_struct_free() was allocated with strdup(). This would cause a crash when using vcd:// streams. Fix to use talloc_strdup().
Diffstat (limited to 'stream')
-rw-r--r--stream/stream_vcd.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/stream/stream_vcd.c b/stream/stream_vcd.c
index 094cd98fe8..5d2eecc27b 100644
--- a/stream/stream_vcd.c
+++ b/stream/stream_vcd.c
@@ -37,6 +37,8 @@
#endif
#include <errno.h>
+#include "talloc.h"
+
#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__) || defined(__NetBSD__) || defined(__OpenBSD__)
#include "vcd_read_fbsd.h"
#elif defined(__APPLE__)
@@ -157,9 +159,9 @@ static int open_s(stream_t *stream,int mode, void* opts, int* file_format) {
if (!p->device) {
if(cdrom_device)
- p->device = strdup(cdrom_device);
+ p->device = talloc_strdup(NULL, cdrom_device);
else
- p->device = strdup(DEFAULT_CDROM_DEVICE);
+ p->device = talloc_strdup(NULL, DEFAULT_CDROM_DEVICE);
}
#if defined(__MINGW32__) || defined(__CYGWIN__)