mirror of
https://github.com/warmcat/libwebsockets.git
synced 2025-03-09 00:00:04 +01:00
coverity: missing malloc return check
This is only coming at vhost startup, for a server that's before we go busy with heap. But still, it should be checked.
This commit is contained in:
parent
ec9e8ab892
commit
24f08fc5c0
2 changed files with 3 additions and 1 deletions
|
@ -327,7 +327,7 @@ set(PACKAGE "libwebsockets")
|
|||
set(CPACK_PACKAGE_NAME "${PACKAGE}")
|
||||
set(CPACK_PACKAGE_VERSION_MAJOR "4")
|
||||
set(CPACK_PACKAGE_VERSION_MINOR "0")
|
||||
set(CPACK_PACKAGE_VERSION_PATCH "20")
|
||||
set(CPACK_PACKAGE_VERSION_PATCH "21")
|
||||
set(CPACK_PACKAGE_RELEASE 1)
|
||||
set(CPACK_GENERATOR "RPM")
|
||||
set(CPACK_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
|
||||
|
|
|
@ -158,6 +158,8 @@ callback_lws_server_status(struct lws *wsi, enum lws_callback_reasons reason,
|
|||
v->period_s = 5;
|
||||
if (!strcmp(pvo->name, "filepath")) {
|
||||
fp = malloc(sizeof(*fp));
|
||||
if (!fp)
|
||||
return -1;
|
||||
fp->next = NULL;
|
||||
lws_snprintf(&fp->filepath[0],
|
||||
sizeof(fp->filepath), "%s",
|
||||
|
|
Loading…
Add table
Reference in a new issue