1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
|
Description: Remove two calls to free with an array as the argument
This is bad code, invoking undefined behaviour if executed. I suspect it
never actually will be, as by default "new" in C++ throws an exception if
it fails, and I don't see anything in the rlplot code to change that.
The issue was spotted by a new GCC warning.
Author: Olly Betts <olly@survex.com>
---
Origin: debian
Forwarded: via http://rlplot.sourceforge.net/Support/index.html
Last-Update: 2011-12-02
--- rlplot-1.5.orig/rlplot.cpp
+++ rlplot-1.5/rlplot.cpp
@@ -1396,7 +1396,6 @@
if(yref2[0] &&((nPnt = rX->CountItems()) == (rY1->CountItems()))) {
if(!(Values = (lfPOINT *)realloc(Values, ((nPnt*2+2) * sizeof(lfPOINT))))) return;
if(!(rY2 = new AccRange(yref2))) {
- if(yref1) free(yref1); if(yref2) free(yref2);
if(rX) delete(rX); if(rY1) delete(rY1);
return;
}
|