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:
parent
2f9ed48d93
commit
07bef6b83c
1 changed files with 6 additions and 3 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue