aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-10-16 15:42:18 +0200
committerMichael Niedermayer <michaelni@gmx.at>2011-10-16 17:12:37 +0200
commitc9833fc33a493b97f675ca666ea314aadae4b7d6 (patch)
tree36f9563d53ae3a3eaf4ef07bc1789e82f4e7fbfe
parent885158c887384c6da247cc061458f2e53367e6b5 (diff)
downloadffmpeg-c9833fc33a493b97f675ca666ea314aadae4b7d6.tar.gz
av_tempfile: fix alloc type for !HAVE_MKSTEMP
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavutil/file.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libavutil/file.c b/libavutil/file.c
index 4d14292ba1..7be095b1f4 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);