From 30cc040365108b0f9099c0cccd81285bb04d6335 Mon Sep 17 00:00:00 2001 From: bhklein Date: Mon, 17 Nov 2014 13:03:51 -0500 Subject: [PATCH] delete flat_gallery and open file at beginning --- openbr/janus_io.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/openbr/janus_io.cpp b/openbr/janus_io.cpp index 56ae726..531fba4 100644 --- a/openbr/janus_io.cpp +++ b/openbr/janus_io.cpp @@ -57,8 +57,9 @@ janus_error janus_create_templates(const char *data_path, janus_metadata metadat JANUS_ASSERT(janus_flatten_gallery(gallery, flat_gallery, &bytes)) std::ofstream file; - file.open(gallery_file, std::ios::out | std::ios::binary | std::ios::ate); + file.open(gallery_file, std::ios::out | std::ios::binary); file.write((char*)flat_gallery, bytes); file.close(); + delete[] flat_gallery; return JANUS_SUCCESS; } -- libgit2 0.21.4