[client/common] fixes for issues detected through static analysis.

This commit is contained in:
Geoffrey McRae committed 2022-03-07 10:14:52 +11:00
1 parent a3820536ab
commit 3a8cb6a613
18 files changed
+228 -24

No files matched your search

+1 -1
View File
@@ -120,7 +120,7 @@ bool ivshmemOpenDev(struct IVSHMEM * dev, const char * shmDevice)
DEBUG_ASSERT(dev);
unsigned int devSize;
int devFd = -1;
int devFd;
bool hasDMA;
dev->opaque = NULL;
+6
View File
@@ -44,6 +44,12 @@ static void * threadWrapper(void * opaque)
bool lgCreateThread(const char * name, LGThreadFunction function, void * opaque, LGThread ** handle)
{
*handle = malloc(sizeof(**handle));
if (!*handle)
{
DEBUG_ERROR("out of memory");
return false;
}
(*handle)->name = name;
(*handle)->function = function;
(*handle)->opaque = opaque;