diff --git a/libIRDB/test/fill_in_cfg.cpp b/libIRDB/test/fill_in_cfg.cpp
index ec45078d0b074122775faf9d8d97a487a4c88d75..6220faffedb0ceae0a462f4b13027f3890ec8ba6 100644
--- a/libIRDB/test/fill_in_cfg.cpp
+++ b/libIRDB/test/fill_in_cfg.cpp
@@ -285,7 +285,10 @@ void add_new_instructions(VariantIR_t *virp)
 
 				/* if we found the instruction, but can't disassemble it, then we skip out for now */
 				if(instr_len==OUT_OF_RANGE || instr_len==UNKNOWN_OPCODE)
+				{
+					free(data);
 					break;
+				}
 
 				/* intel instructions have a max size of 16 */
 				assert(1<=instr_len && instr_len<=16);