X-Git-Url: https://git.deb.at/w?p=pkg%2Fnetris.git;a=blobdiff_plain;f=debian%2Fpatches%2F10_fix-memory-leak;fp=debian%2Fpatches%2F10_fix-memory-leak;h=c975dc49366e8c55c592d616b3664c77dc484e34;hp=0000000000000000000000000000000000000000;hb=614219dca397988b0c2003148ced5570026926df;hpb=20dca2d0a407d3deaa724f3bf90cdd60582e7288 diff --git a/debian/patches/10_fix-memory-leak b/debian/patches/10_fix-memory-leak new file mode 100644 index 0000000..c975dc4 --- /dev/null +++ b/debian/patches/10_fix-memory-leak @@ -0,0 +1,26 @@ +Author: TomaszN vim:ft=diff: +Description: fix memory leak issue, BTS #590942 + +Index: b/curses.c +=================================================================== +--- a/curses.c ++++ b/curses.c +@@ -141,6 +141,8 @@ ExtFunc void GetTermcapInfo(void) + * Allocate it on the heap too. + */ + data = buf = malloc(bufSize); ++ if (buf == NULL) ++ fatal("memory allocation error"); + + /* + * There is no standard include file for tgetstr, no prototype +@@ -154,9 +156,6 @@ ExtFunc void GetTermcapInfo(void) + /* Okay, so I'm paranoid; I just don't like unsafe routines */ + if (data > buf + bufSize) + fatal("tgetstr overflow, you must have a very sick termcap"); +- +- /* Trim off the unused portion of buffer */ +- buf = realloc(buf, data - buf); + } + + /*