Fix memory leaks
Fix memory leaks

Dynamically allocated stack wasn't released in case of timeout or error in function call.

jshufelt/yara,msuvajac/yara,frbapolkosnik/yara,msuvajac/yara,tdr130/yara,neatsun/yara,tanium/yara,cblichmann/yara,smaudet/yara,kallanreed/yara,rednaga/yara,plusvic/yara,msuvajac/yara,bmagistro/yara,jpypi/yara,rayyang2000/yara,wxsBSD/yara,beikezcs/yara,mgoffin/yara,hillu/yara,pombredanne/yara,beikezcs/yara,Security513/yara,tanium/yara,mgoffin/yara,foreni-packages/yara,neatsun/yara,cblichmann/yara,jpypi/yara,mgoffin/yara,tanium/yara,VirusTotal/yara,plusvic/yara,cblichmann/yara,bmagistro/yara,mgoffin/yara,plusvic/yara,wxsBSD/yara,smaudet/yara,hillu/yara,bmagistro/yara,jshufelt/yara,rednaga/yara,pombredanne/yara,pombredanne/yara,plusvic/yara,jpypi/yara,foreni-packages/yara,wxsBSD/yara,wxsBSD/yara,frbapolkosnik/yara,foreni-packages/yara,kallanreed/yara,pombredanne/yara,MeteorAdminz/yara,Security513/yara,tdr130/yara,wxsBSD/yara,jshufelt/yara,kallanreed/yara,tdr130/yara,smaudet/yara,frbapolkosnik/yara,rayyang2000/yara,rayyang2000/yara,MeteorAdminz/yara,jshufelt/yara,hillu/yara,pombredanne/yara,MeteorAdminz/yara,hillu/yara,smaudet/yara,VirusTotal/yara,frbapolkosnik/yara,beikezcs/yara,cblichmann/yara,VirusTotal/yara,rednaga/yara,VirusTotal/yara,neatsun/yara,plusvic/yara,VirusTotal/yara,cblichmann/yara,Security513/yara,hillu/yara