problem reported by ExtraHop networks
diff --git a/skeletons/INTEGER.c b/skeletons/INTEGER.c
index 7fe3e84..3a548e6 100644
--- a/skeletons/INTEGER.c
+++ b/skeletons/INTEGER.c
@@ -576,6 +576,8 @@
 	}
 
 	FREEMEM(st->buf);
+	st->buf = 0;
+	st->size = 0;
 	if(ct) {
 		if(ct->flags & APC_SEMI_CONSTRAINED) {
 			st->buf = (uint8_t *)CALLOC(1, 2);
@@ -586,11 +588,7 @@
 			st->buf = (uint8_t *)MALLOC(1 + size + 1);
 			if(!st->buf) _ASN_DECODE_FAILED;
 			st->size = size;
-		} else {
-			st->size = 0;
 		}
-	} else {
-		st->size = 0;
 	}
 
 	/* X.691, #12.2.2 */