[FFmpeg-cvslog] av_tempfile: fix alloc type for !HAVE_MKSTEMP

Michael Niedermayer git at videolan.org
Sun Oct 16 17:21:22 CEST 2011


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sun Oct 16 15:42:18 2011 +0200| [c9833fc33a493b97f675ca666ea314aadae4b7d6] | committer: Michael Niedermayer

av_tempfile: fix alloc type for !HAVE_MKSTEMP

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c9833fc33a493b97f675ca666ea314aadae4b7d6
---

 libavutil/file.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/libavutil/file.c b/libavutil/file.c
index 4d14292..7be095b 100644
--- a/libavutil/file.c
+++ b/libavutil/file.c
@@ -133,7 +133,10 @@ void av_file_unmap(uint8_t *bufptr, size_t size)
 int av_tempfile(const char *prefix, char **filename) {
     int fd=-1;
 #if !HAVE_MKSTEMP
-    *filename = tempnam(".", prefix);
+    void *ptr= tempnam(".", prefix);
+    *filename = av_strdup(ptr);
+#undef free
+    free(ptr);
 #else
     size_t len = strlen(prefix) + 12; /* room for "/tmp/" and "XXXXXX\0" */
     *filename = av_malloc(len);



More information about the ffmpeg-cvslog mailing list