opnsense-ports/graphics/exact-image/files/patch-codecs__bmp.cc
Franco Fichtner 8cb1a96ede ports: pull in a snapshot of the FreeBSD ports tree
Taken from:	https://github.com/freebsd/freebsd-ports.git
Commit id:	5070672073b68be364139bc6b3a89100bd17d331
2014-11-09 14:03:21 +01:00

26 lines
816 B
C++

--- codecs/bmp.cc.orig 2009-04-27 13:54:29.000000000 -0400
+++ codecs/bmp.cc 2010-01-17 00:32:01.000000000 -0500
@@ -441,6 +441,8 @@
uint8_t* row_data = (uint8_t*) malloc (file_stride);
if (!data || !row_data) {
std::cerr << "Can't allocate space for image buffer\n";
+ free(data);
+ free(row_data);
goto bad1;
}
@@ -522,6 +524,7 @@
comprbuf = (uint8_t *) malloc( compr_size );
if (!comprbuf) {
std::cerr << "Can't allocate space for compressed scanline buffer\n";
+ free(comprbuf);
goto bad1;
}
uncomprbuf = (uint8_t *) malloc( uncompr_size );
@@ -593,6 +596,7 @@
data = (uint8_t *) malloc( uncompr_size );
if (!data) {
std::cerr << "Can't allocate space for final uncompressed scanline buffer\n";
+ free(data);
goto bad1;
}