diff --git a/src/Makefile.include b/src/Makefile.include index 4c8648bd3..393f16476 100644 --- a/src/Makefile.include +++ b/src/Makefile.include @@ -96,6 +96,13 @@ ifeq ($(CONFIG), dmalloc) LIBS += -ldmalloc endif +ifeq ($(CONFIG), ccmalloc) + BUILD_DIR = Ccmalloc-$(ARCHITECTURE) + CFLAGS += -ggdb + LDFLAGS += -ggdb + LD = ccmalloc gcc +endif + # ifeq ($(CONFIG), lint) # BUILD_DIR = Lint-$(ARCHITECTURE) # CC = lint @@ -132,7 +139,7 @@ PUBLISH_DIR = $(ERESSEA)/$(BUILD_DIR) env: @$(MAKEENV) -debug release profile dmalloc:: env $(PUBLISH_DIR) $(PUBLISH_DIR) +debug release profile dmalloc ccmalloc:: env $(PUBLISH_DIR) $(PUBLISH_DIR) $(MAKE) CONFIG=$@ recurse-subdirs-$@ ## @@ -142,12 +149,13 @@ recurse-subdirs-debug:: subdirs-debug publish-debug recurse-subdirs-release:: subdirs-release publish-release recurse-subdirs-profile:: subdirs-profile publish-profile recurse-subdirs-dmalloc:: subdirs-dmalloc publish-dmalloc +recurse-subdirs-ccmalloc:: subdirs-ccmalloc publish-ccmalloc recurse-lint:: lint recurse-clean:: clean recurse-depend:: depend -subdirs-debug subdirs-release subdirs-profile subdirs-dmalloc lint clean depend:: +subdirs-debug subdirs-release subdirs-profile subdirs-dmalloc subdirs-ccmalloc lint clean depend:: @mkdir -p $(PUBLISH_DIR) @if [ -n "$(SUBDIRS)" ]; then \ for subdir in x-placeholder-dir $(SUBDIRS); do \ @@ -163,11 +171,12 @@ publish-debug:: subdirs-debug publish-release:: subdirs-release publish-profile:: subdirs-profile publish-dmalloc:: subdirs-dmalloc +publish-ccmalloc:: subdirs-ccmalloc -publish-debug publish-release publish-profile publish-dmalloc:: $(PUBLISH_DIR)/$(LIBRARY) $(PUBLISH_DIR)/$(BINARY) +publish-debug publish-release publish-profile publish-ccmalloc:: $(PUBLISH_DIR)/$(LIBRARY) $(PUBLISH_DIR)/$(BINARY) clean:: $(BUILD_DIR) $(PUBLISH_DIR) - rm -fr Release-$(ARCHITECTURE)/* Debug-$(ARCHITECTURE)/* Profile-$(ARCHITECTURE)/* Dmalloc-$(ARCHITECTURE)/* Lint-$(ARCHITECTURE)/* + rm -fr Release-$(ARCHITECTURE)/* Debug-$(ARCHITECTURE)/* Profile-$(ARCHITECTURE)/* Dmalloc-$(ARCHITECTURE)/* Ccmalloc-$(ARCHITECTURE) Lint-$(ARCHITECTURE)/* lint:: $(LINT) -I$(ERESSEA) $(INCLUDES) $(LINTFLAGS) *.c diff --git a/src/common/util/xml.c b/src/common/util/xml.c index fc7ee36fe..d09ec07ca 100644 --- a/src/common/util/xml.c +++ b/src/common/util/xml.c @@ -72,7 +72,7 @@ static void free_attribs(xml_attrib * xa) { free(xa->name); - free(xa->value); + if(xa->value) free(xa->value); free(xa); }