Skip to content

Commit

Permalink
Fix errors found by cppcheck
Browse files Browse the repository at this point in the history
  • Loading branch information
AMDmi3 committed Feb 5, 2014
1 parent 8feb65f commit 4fb1457
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/RenderManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ void RenderManager::drawPolygon(std::vector<int> withArrayOfCoordinates, unsigne
glVertexPointer(3, GL_FLOAT, 0, spotVertCoords);
glDrawArrays(GL_TRIANGLE_FAN, 0, sizeOfArray >> 1);

delete spotVertCoords;
delete[] spotVertCoords;

glPopMatrix();
}
Expand Down
5 changes: 4 additions & 1 deletion src/stb_image.c
Original file line number Diff line number Diff line change
Expand Up @@ -3299,7 +3299,10 @@ static stbi_uc *tga_load(stbi *s, int *x, int *y, int *comp, int req_comp)
skip(s, tga_palette_start );
// load the palette
tga_palette = (unsigned char*)malloc( tga_palette_len * tga_palette_bits / 8 );
if (!tga_palette) return epuc("outofmem", "Out of memory");
if (!tga_palette) {
free(tga_data);
return epuc("outofmem", "Out of memory");
}
if (!getn(s, tga_palette, tga_palette_len * tga_palette_bits / 8 )) {
free(tga_data);
free(tga_palette);
Expand Down

0 comments on commit 4fb1457

Please sign in to comment.