diff options
-rw-r--r-- | crypto/x509/v3_sxnet.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/crypto/x509/v3_sxnet.c b/crypto/x509/v3_sxnet.c index 8540f10d1e..36620a2b67 100644 --- a/crypto/x509/v3_sxnet.c +++ b/crypto/x509/v3_sxnet.c @@ -123,7 +123,11 @@ int SXNET_add_id_asc(SXNET **psx, const char *zone, const char *user, int userle ERR_raise(ERR_LIB_X509V3, X509V3_R_ERROR_CONVERTING_ZONE); return 0; } - return SXNET_add_id_INTEGER(psx, izone, user, userlen); + if (!SXNET_add_id_INTEGER(psx, izone, user, userlen)) { + ASN1_INTEGER_free(izone); + return 0; + } + return 1; } /* Add an id given the zone as an unsigned long */ @@ -139,8 +143,11 @@ int SXNET_add_id_ulong(SXNET **psx, unsigned long lzone, const char *user, ASN1_INTEGER_free(izone); return 0; } - return SXNET_add_id_INTEGER(psx, izone, user, userlen); - + if (!SXNET_add_id_INTEGER(psx, izone, user, userlen)) { + ASN1_INTEGER_free(izone); + return 0; + } + return 1; } /* |