Fix memory leaks

Change-Id: I2933bc09af6de8210a536f945cc22b66814d4096
Signed-off-by: Lukas Selinka <lukas.selinka@secunet.com>
Reviewed-on: https://review.sourcearcade.org/c/flashprog/+/587
Reviewed-by: Nico Huber <nico.h@gmx.de>
Tested-by: Nico Huber <nico.h@gmx.de>
diff --git a/libflashprog.c b/libflashprog.c
index 24885a3..c2c12a1 100644
--- a/libflashprog.c
+++ b/libflashprog.c
@@ -177,6 +177,9 @@
 {
 	if (programmer_shutdown(flashprog))
 		return 1;
+
+	if (flashprog->param)
+		free(flashprog->param);
 	free(flashprog);
 	return 0;
 }