diff --git a/src/ChangeLog b/src/ChangeLog
index d1358bfa..001d3909 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,9 @@
+2011-11-04 Steven Schweda
+
+ * warc.c [! WINDOWS]: Include .
+ (warc_write_warcinfo_record): Assign a new allocated buffer and
+ free it on errors.
+
2011-11-01 Steven Schweda
* gnutls.c (ssl_init): Ensure GNU TLS is loaded only once.
diff --git a/src/warc.c b/src/warc.c
index 77ef3692..33488c4e 100644
--- a/src/warc.c
+++ b/src/warc.c
@@ -19,6 +19,10 @@
#include
#endif
+#ifndef WINDOWS
+#include
+#endif
+
#include "warc.h"
extern char *version_string;
@@ -605,7 +609,7 @@ warc_write_warcinfo_record (char *filename)
char *filename_copy, *filename_basename;
filename_copy = strdup (filename);
- filename_basename = basename (filename_copy);
+ filename_basename = strdup (basename (filename_copy));
warc_write_start_record ();
warc_write_header ("WARC-Type", "warcinfo");
@@ -619,6 +623,7 @@ warc_write_warcinfo_record (char *filename)
if (warc_tmp == NULL)
{
free (filename_copy);
+ free (filename_basename);
return false;
}
@@ -646,6 +651,7 @@ warc_write_warcinfo_record (char *filename)
}
free (filename_copy);
+ free (filename_basename);
fclose (warc_tmp);
return warc_write_ok;
}