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

@@ -446,6 +446,7 @@ istrP_create_alloced_impl(
fprintf(stderr, "%s",
catgets(UTIL_MESSAGE_CATD, UTIL_MESSAGE_SET, 2,
"ISTR: error in allocating space for string\n") );
free(new_bucket);
return NULL;
}
new_bucket->values[0] = freelist[freecount-1];
@@ -625,6 +626,7 @@ istr_create_const(
fprintf(stderr, "%s",
catgets(UTIL_MESSAGE_CATD, UTIL_MESSAGE_SET, 2,
"ISTR: error in allocating space for string\n") );
free(new_bucket);
return NULL;
}
new_bucket->values[0] = freelist[freecount-1];

View File

@@ -641,6 +641,8 @@ strlistP_grow_array(StringList list, int sizeDiff)
if ((new_strings == NULL) || (new_user_datas == NULL))
{
return_value = -1;
free(new_strings);
free(new_user_datas);
goto epilogue;
}
else

View File

@@ -563,6 +563,7 @@ util_derive_name_from_path(
len = strlen(name) - (AB_EXT_LENGTH + 1);
strncpy(objname, name, len);
objname[len] = '\0';
free(name);
}
else
{