From 6845255188f3ee6c4fd7e4647869858722ae6053 Mon Sep 17 00:00:00 2001 From: "Thomas M. DuBuisson" Date: Mon, 11 Nov 2019 18:50:30 -0800 Subject: [PATCH] Memory leak --- c-src/point.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/c-src/point.c b/c-src/point.c index 757e6c9..819c26b 100644 --- a/c-src/point.c +++ b/c-src/point.c @@ -32,6 +32,17 @@ void print_point(struct POINT *pnt) get_x(pnt), get_y(pnt)); } +int memory_leak() +{ + struct POINT *p = malloc(sizeof(struct POINT)); + + if (p == NULL) { + return (-2); + } + + return -1; +} + int main(void) { struct POINT *pnt = malloc(sizeof(struct POINT));