1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-09 00:00:04 +01:00

coverity: ntp from blob: handle blob missing

This commit is contained in:
Andy Green 2021-06-04 14:57:49 +01:00
parent 2f9ed48d93
commit 07bef6b83c

View file

@ -127,9 +127,12 @@ lws_plat_ntpclient_config(struct lws_context *context)
char *ntpsrv = getenv("LWS_NTP_SERVER");
if (ntpsrv && strlen(ntpsrv) < 64) {
lws_system_blob_direct_set(lws_system_get_blob(context,
LWS_SYSBLOB_TYPE_NTP_SERVER, 0),
(const uint8_t *)ntpsrv,
lws_system_blob_t *blob = lws_system_get_blob(context,
LWS_SYSBLOB_TYPE_NTP_SERVER, 0);
if (!blob)
return 0;
lws_system_blob_direct_set(blob, (const uint8_t *)ntpsrv,
strlen(ntpsrv));
return 1;
}