summaryrefslogtreecommitdiffstats
path: root/crypto/o_time.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/o_time.c')
-rw-r--r--crypto/o_time.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/crypto/o_time.c b/crypto/o_time.c
index ca5f3ea48e..723eb1b5af 100644
--- a/crypto/o_time.c
+++ b/crypto/o_time.c
@@ -80,8 +80,10 @@ struct tm *OPENSSL_gmtime(const time_t *timer, struct tm *result)
ts = result;
#elif !defined(OPENSSL_SYS_VMS)
ts = gmtime(timer);
- if (ts != NULL)
- memcpy(result, ts, sizeof(struct tm));
+ if (ts == NULL)
+ return NULL;
+
+ memcpy(result, ts, sizeof(struct tm));
ts = result;
#endif
#ifdef OPENSSL_SYS_VMS