We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 182d693 commit 56779b1Copy full SHA for 56779b1
common/rules.mk
@@ -7,6 +7,9 @@ O ?= -O3
7
ifeq ($(filter 0 1 2 3 s,$(O)),$(strip $(O)))
8
override O := -O$(O)
9
endif
10
+ifeq ($(SANITIZE),1)
11
+CC += -fsanitize=address -fsanitize=undefined
12
+endif
13
14
# these rules ensure dependencies are created
15
DEPCFLAGS = -MD -MF $(DEPSDIR)/$*.d -MP
fundamentals3/addrspace.c
@@ -18,5 +18,7 @@ int main(int argc, char* argv[]) {
18
printf("Address of a const local variable\t%p\n", &const_local_ch);
19
printf("Address of a heap variable\t\t%p\n", heap_ch);
20
printf("Address of main\t\t\t\t%p\n", main);
21
+
22
+ free(heap_ch);
23
return 0;
24
}
0 commit comments