You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by "yiguolei (via GitHub)" <gi...@apache.org> on 2023/04/26 04:13:47 UTC

[GitHub] [doris] yiguolei commented on a diff in pull request #19027: [bug](fix) fix geo memory leak

yiguolei commented on code in PR #19027:
URL: https://github.com/apache/doris/pull/19027#discussion_r1177315106


##########
be/src/geo/geo_tobinary.cpp:
##########
@@ -93,6 +93,7 @@ bool toBinary::writeGeoPolygon(doris::GeoPolygon* polygon, ToBinaryContext* ctx)
     for (int i = 0; i < coordss->list.size(); ++i) {
         writeCoordinateList(*coordss->list[i], true, ctx);
     }
+    delete coordss;

Review Comment:
   Not fix it in this way. Should refactor the code in GeoPolygon and return a unique ptr here.
   Current code may memory leak if user call return before line 96



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org