diff --git a/drivers/wireless/gs2200m.c b/drivers/wireless/gs2200m.c index 1a2e5864ab..f33dc2a276 100644 --- a/drivers/wireless/gs2200m.c +++ b/drivers/wireless/gs2200m.c @@ -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; } diff --git a/fs/nxffs/nxffs_pack.c b/fs/nxffs/nxffs_pack.c index d57b65bdde..24c5c562bf 100644 --- a/fs/nxffs/nxffs_pack.c +++ b/fs/nxffs/nxffs_pack.c @@ -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));