av_tempfile: fix alloc type for !HAVE_MKSTEMP

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
pull/2/head
Michael Niedermayer 13 years ago
parent 885158c887
commit c9833fc33a
  1. 5
      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);

Loading…
Cancel
Save