dtappbuilder: Further coverity, resource leaks, copy intofixed size buffer and dereference before null checl

This commit is contained in:
Peter Howkins
2018-04-28 02:51:10 +01:00
parent 0aa8780fa1
commit a135a89876
18 changed files with 82 additions and 44 deletions

View File

@@ -566,6 +566,8 @@ objlistP_grow_array(ABObjList list, int sizeDiff)
if ( (new_objs == NULL)
|| (user_datas_valid && (new_user_datas == NULL)) )
{
free(new_objs);
free(new_user_datas);
return_value = ERR_NO_MEMORY;
goto epilogue;
}

View File

@@ -1197,13 +1197,14 @@ obj_verify(ABObj obj)
if (ok)
{
obj_str_ptr_name = istr_string(obj->name);
sprintf((STRING)obj_name, "(ABObj %#lx", (unsigned long) obj);
if (obj_str_ptr_name != NULL)
{
strcat((STRING)obj_name, " = ");
strcat((STRING)obj_name, obj_str_ptr_name);
snprintf((STRING)obj_name, sizeof(obj_name),
"(ABObj %#lx = %s)", (unsigned long) obj, obj_str_ptr_name);
} else {
snprintf((STRING)obj_name, sizeof(obj_name),
"(ABObj %#lx)", (unsigned long) obj);
}
strcat((STRING)obj_name, ")");
if (!ok)
{
field_err("name");

View File

@@ -102,6 +102,7 @@ travP_open_safe(
/* don't call travP_close(trav) - keep the traversal open */
if (iRet < 0)
{
util_free(objArray);
return iRet;
}