malloc + free
authorFrantišek Kučera <franta-hg@frantovo.cz>
Thu, 21 Dec 2017 18:13:35 +0100
changeset 7379c490a9831
parent 6 d55ac7dbc2e6
child 8 d4b2ec9ef8bc
malloc + free
c++/rgb-assembler/rgb-assembler.cpp
     1.1 --- a/c++/rgb-assembler/rgb-assembler.cpp	Thu Dec 21 17:52:30 2017 +0100
     1.2 +++ b/c++/rgb-assembler/rgb-assembler.cpp	Thu Dec 21 18:13:35 2017 +0100
     1.3 @@ -78,7 +78,7 @@
     1.4  		writeCommand(memory, a, CMD_SLEEP);
     1.5  		writeSleep(memory, a, 255);
     1.6  		writeCommand(memory, a, CMD_GOTO);
     1.7 -		writeAddress(memory, a, a+4);
     1.8 +		writeAddress(memory, a, a + 4);
     1.9  		writeCommand(memory, a, 1);
    1.10  		writeCommand(memory, a, 1);
    1.11  		writeCommand(memory, a, CMD_SLEEP);
    1.12 @@ -118,6 +118,8 @@
    1.13  
    1.14  
    1.15  
    1.16 +	free(memory);
    1.17 +	memory = nullptr;
    1.18  	wprintf(L"all done\n");
    1.19  	return 0;
    1.20  }