summaryrefslogtreecommitdiff
path: root/source4/libcli/util/asn1.c
diff options
context:
space:
mode:
Diffstat (limited to 'source4/libcli/util/asn1.c')
-rw-r--r--source4/libcli/util/asn1.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/source4/libcli/util/asn1.c b/source4/libcli/util/asn1.c
index ca62a0b574..3dc5abc09a 100644
--- a/source4/libcli/util/asn1.c
+++ b/source4/libcli/util/asn1.c
@@ -566,7 +566,13 @@ BOOL asn1_read_OctetString(ASN1_DATA *data, DATA_BLOB *blob)
*blob = data_blob(NULL, len);
asn1_read(data, blob->data, len);
asn1_end_tag(data);
- return !data->has_error;
+
+ if (data->has_error) {
+ data_blob_free(blob);
+ *blob = data_blob(NULL, 0);
+ return False;
+ }
+ return True;
}
BOOL asn1_read_ContextSimple(ASN1_DATA *data, uint8_t num, DATA_BLOB *blob)