]> git.xonotic.org Git - xonotic/gmqcc.git/blobdiff - pak.c
Fix possible bug
[xonotic/gmqcc.git] / pak.c
diff --git a/pak.c b/pak.c
index a272e9e0fd0a88c34460e2563c97239d12b52b30..043ef8957a53ffed4817fda9bb5d3f9a8e28fc14 100644 (file)
--- a/pak.c
+++ b/pak.c
@@ -20,8 +20,6 @@
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  * SOFTWARE.
  */
-#include <sys/stat.h>
-#include <dirent.h>
 #include "gmqcc.h"
 
 /*
@@ -96,7 +94,6 @@ static void pak_tree_build(const char *entry) {
     directory = (char *)mem_a(56);
 
     memset(pathsplit, 0, 56);
-    memset(directory, 0, 56);
 
     strncpy(directory, entry, 56);
     for (itr = 0; (token = pak_tree_sep(&directory, "/")) != NULL; itr++) {
@@ -197,6 +194,7 @@ static pak_file_t *pak_open_write(const char *file) {
          */   
         /* TODO backup directory clean */
 
+        mem_d(pak);
         return NULL;
     }