[ 
https://issues.apache.org/jira/browse/AVRO-4246?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18085568#comment-18085568
 ] 

ASF subversion and git services commented on AVRO-4246:
-------------------------------------------------------

Commit ba832f245dddeed06e6272fcbaceb89fe8c55e1a in avro's branch 
refs/heads/branch-1.12 from Fábio Lucas Carneiro
[ https://gitbox.apache.org/repos/asf?p=avro.git;h=ba832f245d ]

AVRO-4246: [c] Fix memory leak on failed decoding (#3732)

* AVRO-4246: Add 'AVRO_READ_OR_FREE' macro.

* AVRO-4246: Replace 'AVRO_READ' by 'AVRO_READ_OR_FREE' in 'read_string' and 
'read_bytes' functions.

* AVRO-4246: Add 'test_avro_4246.c' to test suite.

---------

Co-authored-by: flpereir <[email protected]>
Co-authored-by: kwenzh <[email protected]>

> Memory Leak in avroc on failed decoding
> ---------------------------------------
>
>                 Key: AVRO-4246
>                 URL: https://issues.apache.org/jira/browse/AVRO-4246
>             Project: Apache Avro
>          Issue Type: Bug
>          Components: c
>    Affects Versions: 1.12.1
>         Environment: On any installation of the avroc library that attempts 
> to decode an incorrectly encoded string.
>            Reporter: Fabio Carneiro
>            Priority: Major
>              Labels: bug, important, memory-bug, pull-request-available
>         Attachments: diff.png
>
>   Original Estimate: 2h
>          Time Spent: 1h 50m
>  Remaining Estimate: 10m
>
> The _read_string_ and _read_bytes_ functions in the _binary_encoding.c_ 
> translation unit does not free the allocated buffer if an error results from 
> a call to _read_value_ originating from the _AVRO_READ_ macro.
>  
> My plan to fix the is to introduce a new macro called _AVRO_READ_OR_FREE_ 
> (name up for change) that frees the buffer in case of error.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to