Added missing checks in strdup'ed strings.
This commit is contained in:
parent
098b7bbfb3
commit
ab1b3c0337
@ -3506,6 +3506,12 @@ FAR void *gs2200m_register(FAR const char *devpath,
|
||||
|
||||
nxmutex_init(&dev->dev_lock);
|
||||
|
||||
if (!dev->path)
|
||||
{
|
||||
wlerr("Failed to allocate driver path.\n");
|
||||
goto errout;
|
||||
}
|
||||
|
||||
ret = gs2200m_initialize(dev, lower);
|
||||
if (ret < 0)
|
||||
{
|
||||
@ -3531,6 +3537,7 @@ FAR void *gs2200m_register(FAR const char *devpath,
|
||||
|
||||
errout:
|
||||
nxmutex_destroy(&dev->dev_lock);
|
||||
lib_free(dev->path);
|
||||
kmm_free(dev);
|
||||
return NULL;
|
||||
}
|
||||
|
@ -1093,6 +1093,8 @@ nxffs_setupwriter(FAR struct nxffs_volume_s *volume,
|
||||
pack->dest.entry.utc = wrfile->ofile.entry.utc;
|
||||
pack->dest.entry.datlen = wrfile->ofile.entry.datlen;
|
||||
|
||||
DEBUGASSERT(pack->dest.entry.name != NULL);
|
||||
|
||||
memset(&pack->src, 0, sizeof(struct nxffs_packstream_s));
|
||||
memcpy(&pack->src.entry, &wrfile->ofile.entry,
|
||||
sizeof(struct nxffs_entry_s));
|
||||
|
Loading…
Reference in New Issue
Block a user