#include <stdio.h>
#include <time.h>
-#include "cryptlib.h"
+#include "internal/cryptlib.h"
#include <openssl/asn1.h>
#include "asn1_locl.h"
int free_s = 0;
if (s == NULL) {
- free_s = 1;
s = ASN1_UTCTIME_new();
+ if (s == NULL)
+ goto err;
+ free_s = 1;
}
- if (s == NULL)
- goto err;
ts = OPENSSL_gmtime(&t, &data);
if (ts == NULL)
ASN1err(ASN1_F_ASN1_UTCTIME_ADJ, ERR_R_MALLOC_FAILURE);
goto err;
}
- if (s->data != NULL)
- OPENSSL_free(s->data);
+ OPENSSL_free(s->data);
s->data = (unsigned char *)p;
}
#endif
return (s);
err:
- if (free_s && s)
+ if (free_s)
ASN1_UTCTIME_free(s);
return NULL;
}