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().
This commit is contained in:
Uoti Urpala 2012-01-16 22:33:52 +02:00
parent 668654098e
commit 6c57eeb7ad
1 changed files with 4 additions and 2 deletions

View File

@ -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__)