Add a couple of return values check

now that pcerror is not guaranteed to exit it is worth checking returns
This commit is contained in:
Sandro Santilli 2015-02-09 19:56:37 +01:00
parent aebb3cb0d3
commit 9243eeaaee
2 changed files with 2 additions and 0 deletions

View File

@ -293,6 +293,7 @@ PCPATCH_DIMENSIONAL *
pc_patch_dimensional_from_pointlist(const PCPOINTLIST *pdl)
{
PCPATCH_UNCOMPRESSED *patch = pc_patch_uncompressed_from_pointlist(pdl);
if ( ! patch ) return NULL;
PCPATCH_DIMENSIONAL *dimpatch = pc_patch_dimensional_from_uncompressed(patch);
pc_patch_uncompressed_free(patch);
return dimpatch;

View File

@ -39,6 +39,7 @@ pc_patch_uncompressed_to_string(const PCPATCH_UNCOMPRESSED *patch)
if ( ! pc_point_get_double_by_index(pt, j, &d))
{
pcerror("%s: unable to read double at index %d", __func__, j);
return NULL;
}
if ( j )
{