sealed possible memory leak when WCFilterGROUP is created.

This commit is contained in:
techdragon.nguyen@gmail.com
2011-02-13 13:28:25 +00:00
parent 5be429c48f
commit 67026849a6
+3 -1
View File
@@ -51,7 +51,7 @@ WCardFilter * WCFilterFactory::Construct(string src)
{ {
WCFilterGROUP * g = NEW WCFilterGROUP(Construct(src.substr(i + 1, endp - 1))); WCFilterGROUP * g = NEW WCFilterGROUP(Construct(src.substr(i + 1, endp - 1)));
if (endp < src.size()) if (endp < src.size())
{ {
if (src[endp + 1] == '|') if (src[endp + 1] == '|')
return NEW WCFilterOR(g, Construct(src.substr(endp + 2))); return NEW WCFilterOR(g, Construct(src.substr(endp + 2)));
else if (src[endp + 1] == '&') else if (src[endp + 1] == '&')
@@ -59,6 +59,7 @@ WCardFilter * WCFilterFactory::Construct(string src)
else else
return g; return g;
} }
SAFE_DELETE( g );
} }
else else
return NEW WCFilterNULL(); return NEW WCFilterNULL();
@@ -78,6 +79,7 @@ WCardFilter * WCFilterFactory::Construct(string src)
else else
return g; return g;
} }
SAFE_DELETE( g );
} }
else else
return NEW WCFilterNULL(); return NEW WCFilterNULL();