From c7f25b6daa5ce8d7bfdf6ec6fb97e8e70151de12 Mon Sep 17 00:00:00 2001 From: orbitcowboy Date: Fri, 15 Jan 2016 16:23:52 +0100 Subject: [PATCH] Cleanup indentation and added missing free(). --- 02.wo_Defects/uninit_pointer.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/02.wo_Defects/uninit_pointer.c b/02.wo_Defects/uninit_pointer.c index 23bf2a6..2db7252 100644 --- a/02.wo_Defects/uninit_pointer.c +++ b/02.wo_Defects/uninit_pointer.c @@ -225,9 +225,9 @@ void uninit_pointer_011 () unsigned int * ptr = NULL,a=0; ptr = (unsigned int *)malloc(10*sizeof(unsigned int *)); int i; - if (ptr!=NULL) - { - while(1) + if (ptr!=NULL) + { + while(1) { for(i=0; i<10; i++) { @@ -243,7 +243,8 @@ void uninit_pointer_011 () } break; } - } + } + free(ptr); } /*