Fix various issues noted by Coverity

This commit is contained in:
Alan Carvalho de Assis
2018-02-06 09:13:16 -06:00
committed by Gregory Nutt
parent 56bb76caca
commit fb50c44d08
8 changed files with 34 additions and 19 deletions
+8 -3
View File
@@ -309,12 +309,17 @@ FAR struct ieee802154_primitive_s *ieee802154_primitive_allocate(void)
/* Check if we allocated the primitive structure */
if (prim != NULL)
if (prim == NULL)
{
/* Yes... remember that this primitive structure was dynamically allocated */
/* No.. memory not available */
pool = POOL_PRIMITIVE_DYNAMIC;
wlerr("ERROR: Failed to allocate primitive.\n");
return NULL;
}
/* Remember that this primitive structure was dynamically allocated */
pool = POOL_PRIMITIVE_DYNAMIC;
}
}