Skip to content

Commit

Permalink
Merge pull request #181 from kanurag94/png-xaos
Browse files Browse the repository at this point in the history
Fix XaoS memory leak issues
  • Loading branch information
kovzol authored Jul 1, 2020
2 parents b1e312d + bf41297 commit fe9dfe1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
4 changes: 0 additions & 4 deletions src/ui/image_qt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,6 @@ const char* readpng(xio_constpath filename)

static void freeImage(struct image *img)
{
QImage **data = (QImage **)(img->data);
delete data[0];
delete data[1];
delete data;
free(img);
}

Expand Down
4 changes: 2 additions & 2 deletions src/util/xstdio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,9 @@ xio_path xio_getdirectory(xio_constpath filename)

xio_path xio_getfilename(const char *basename, const char *extension)
{
int pathlength = strlen(basename) + strlen(extension);
size_t pathlength = strlen(basename) + strlen(extension);
static char* name;
name = (char* )malloc(pathlength);
name = (char* )malloc(pathlength + 16); //Extra padding for memory leak fix
int nimage = 0;
struct stat sb;
char *base = xio_fixpath(basename);
Expand Down

0 comments on commit fe9dfe1

Please sign in to comment.