summaryrefslogtreecommitdiff
path: root/lib/opencdk/read-packet.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/opencdk/read-packet.c')
-rw-r--r--lib/opencdk/read-packet.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/opencdk/read-packet.c b/lib/opencdk/read-packet.c
index a7575bf85f..faee419bc2 100644
--- a/lib/opencdk/read-packet.c
+++ b/lib/opencdk/read-packet.c
@@ -509,8 +509,10 @@ read_attribute(cdk_stream_t inp, size_t pktlen, cdk_pkt_userid_t attr,
p++;
len--;
- if (len >= pktlen)
+ if (len >= pktlen) {
+ cdk_free(buf);
return CDK_Inv_Packet;
+ }
attr->attrib_img = cdk_calloc(1, len);
if (!attr->attrib_img) {
cdk_free(buf);