[sword-devel] Minor memory leak in diatheke

Jaak Ristioja jaak at ristioja.ee
Mon Oct 19 11:53:30 EDT 2020


Hi Troy,

In one sense this is a tempting proposal, but I don't think that would 
be a very good arrangement at this time. However, thank you for the 
offer! :)

J

On 19.10.20 16:34, Troy A. Griffitts wrote:
> Hi Jaak,
> 
> Thank you. diatheke was initially written and owned by Chris Little, but 
> he's been gone now for a while.  Happy for a new owner if you'd like to 
> take it up.
> 
> 
> On 10/19/20 1:24 PM, Jaak Ristioja wrote:
>> Hello!
>>
>> There is a minor memory leak in utilities/diatheke/diatheke.cpp 
>> related to the following allocation when parsing the query key (-k 
>> option):
>>
>>                 ref = new char[key.length() + 1];
>>                 strcpy (ref, key.c_str());
>>                 if (strlen(ref))
>>                     runquery |= RQ_REF;
>>             }
>>
>> The memory allocated is not freed when returning from the function nor 
>> before overwriting its address in the ref variable in cases the user 
>> passes multiple -k options for some strange reason.
>>
>> Best regards,
>> J
>> _______________________________________________
>> sword-devel mailing list: sword-devel at crosswire.org
>> http://crosswire.org/mailman/listinfo/sword-devel
>> Instructions to unsubscribe/change your settings at above page
> _______________________________________________
> sword-devel mailing list: sword-devel at crosswire.org
> http://crosswire.org/mailman/listinfo/sword-devel
> Instructions to unsubscribe/change your settings at above page



More information about the sword-devel mailing list