<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:08:46 UTC 2024

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary append 'field=key&field=summary' to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>MongoDB Jira</title>
    <link>https://jira.mongodb.org</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>9.7.1</version>
        <build-number>970001</build-number>
        <build-date>13-04-2023</build-date>
    </build-info>


<item>
            <title>[CDRIVER-209] mongo_cursor_get_more should not call mongo_cursor_destroy</title>
                <link>https://jira.mongodb.org/browse/CDRIVER-209</link>
                <project id="10030" key="CDRIVER">C Driver</project>
                    <description>&lt;p&gt;The function mongo_cursor_get_more() should not call mongo_cursor_destroy(),&lt;br/&gt;
because then it&apos;s impossible to know whether this should be done in the client,&lt;br/&gt;
since all paths just result in MONGO_ERROR being returned.&lt;/p&gt;

&lt;p&gt;Diff, which includes the incorrect bson_free mentioned in ticket &lt;a href=&quot;https://jira.mongodb.org/browse/CDRIVER-208&quot; title=&quot;mongo_cursor_get_more has invalid free of cursor-&amp;gt;reply&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CDRIVER-208&quot;&gt;&lt;del&gt;CDRIVER-208&lt;/del&gt;&lt;/a&gt;:&lt;/p&gt;

&lt;p&gt;diff --git a/src/mongo.c b/src/mongo.c&lt;br/&gt;
index c8df093..3487488 100644&lt;br/&gt;
&amp;#8212; a/src/mongo.c&lt;br/&gt;
+++ b/src/mongo.c&lt;br/&gt;
@@ -1269,16 +1269,13 @@ static int mongo_cursor_get_more( mongo_cursor *cursor ) {&lt;br/&gt;
         data = mongo_data_append32( data, &amp;amp;limit );&lt;br/&gt;
         mongo_data_append64( data, &amp;amp;cursor-&amp;gt;reply-&amp;gt;fields.cursorID );&lt;/p&gt;

&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;bson_free( cursor-&amp;gt;reply );&lt;br/&gt;
         res = mongo_message_send( cursor-&amp;gt;conn, mm );&lt;br/&gt;
         if( res != MONGO_OK ) 
{
-            mongo_cursor_destroy( cursor );
             return MONGO_ERROR;
         }&lt;br/&gt;
 &lt;br/&gt;
         res = mongo_read_response( cursor-&amp;gt;conn, &amp;amp;( cursor-&amp;gt;reply ) );&lt;br/&gt;
         if( res != MONGO_OK ) {-            mongo_cursor_destroy( cursor );             return MONGO_ERROR;         }
&lt;p&gt;         cursor-&amp;gt;current.data = NULL;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
</description>
                <environment></environment>
        <key id="72369">CDRIVER-209</key>
            <summary>mongo_cursor_get_more should not call mongo_cursor_destroy</summary>
                <type id="1" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14703&amp;avatarType=issuetype">Bug</type>
                                            <priority id="3" iconUrl="https://jira.mongodb.org/images/icons/priorities/major.svg">Major - P3</priority>
                        <status id="6" iconUrl="https://jira.mongodb.org/images/icons/statuses/closed.png" description="The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.">Closed</status>
                    <statusCategory id="3" key="done" colorName="success"/>
                                    <resolution id="9">Done</resolution>
                                        <assignee username="gjmurakami">Gary Murakami</assignee>
                                    <reporter username="basic70">Daniel Brahneborg</reporter>
                        <labels>
                    </labels>
                <created>Fri, 19 Apr 2013 14:05:22 +0000</created>
                <updated>Fri, 9 Aug 2013 20:53:16 +0000</updated>
                            <resolved>Fri, 9 Aug 2013 20:53:16 +0000</resolved>
                                    <version>0.7.1</version>
                                    <fixVersion>0.8.1</fixVersion>
                                                        <votes>1</votes>
                                    <watches>3</watches>
                                                                                                                <comments>
                            <comment id="398997" author="auto" created="Thu, 8 Aug 2013 20:48:21 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;username&apos;: u&apos;gjmurakami-10gen&apos;, u&apos;name&apos;: u&apos;Gary J. Murakami&apos;, u&apos;email&apos;: u&apos;gary.murakami@10gen.com&apos;}
&lt;p&gt;Message: mongo_cursor_get_more should not call mongo_cursor_destroy&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/browse/CDRIVER-209&quot; title=&quot;mongo_cursor_get_more should not call mongo_cursor_destroy&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CDRIVER-209&quot;&gt;&lt;del&gt;CDRIVER-209&lt;/del&gt;&lt;/a&gt;&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-c-driver/commit/a636d6421eb2705055b4b1b72b148653311aa690&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-c-driver/commit/a636d6421eb2705055b4b1b72b148653311aa690&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="319471" author="basic70" created="Tue, 23 Apr 2013 10:46:54 +0000"  >&lt;p&gt;As far as I can see, both calls must be removed.&lt;/p&gt;</comment>
                            <comment id="319467" author="auny" created="Tue, 23 Apr 2013 10:41:23 +0000"  >&lt;p&gt;Encountered the same issue with tailable cursor with mongo restarting. So which one is the better approach? Removing the extraneous bson_free() call which causes a double free on reply? or removing the mongo_cursor_destroy() call?&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_15850" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hrndfb:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>50126</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            </customfields>
    </item>
</channel>
</rss>