From 0dd49b7f5be029d7eff0806beb713bac8c7e1071 Mon Sep 17 00:00:00 2001 From: Allanis <allanis@saracraft.net> Date: Mon, 6 Jan 2014 19:53:29 +0000 Subject: [PATCH] [Fix] Fixed mem leak. --- bin/Makefile | 2 +- src/unidiff.c | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/bin/Makefile b/bin/Makefile index 05b8f58..79d8123 100644 --- a/bin/Makefile +++ b/bin/Makefile @@ -15,7 +15,7 @@ export OS # VERSION. VMAJOR := 0 VMINOR := 3 -VREV := 1 +VREV := 2 VERSION = -DVMAJOR=$(VMAJOR) -DVMINOR=$(VMINOR) -DVREV=$(VREV) VERSIONFILE = VERSION diff --git a/src/unidiff.c b/src/unidiff.c index 276aec5..1cbf7b4 100644 --- a/src/unidiff.c +++ b/src/unidiff.c @@ -173,8 +173,14 @@ int diff_apply(char* name) { /* Check to see if it's the diff we're looking for. */ xmlr_attr(node, "name", diffname); if(strcmp(diffname, name)==0) { + /* Apply it. */ diff_patch(node); + + /* Clean up. */ free(diffname); + xmlFreeDoc(doc); + free(buf); + return 0; } free(diffname);