Page MenuHomePhabricator

elm: Fix potential leak in cv request add
ClosedPublic

Authored by lauromoura on Wed, Sep 25, 3:42 PM.

Diff Detail

Repository
rEFL core/efl
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
lauromoura created this revision.Wed, Sep 25, 3:42 PM
lauromoura requested review of this revision.Wed, Sep 25, 3:42 PM
lauromoura added inline comments.Thu, Sep 26, 6:35 AM
src/lib/elementary/efl_ui_collection_view.c
1856

@bu5hm4n , shouldn't this #endif and label be after the if block below?

Just like the other methods that notify the manager.

cedric added inline comments.Thu, Sep 26, 7:32 AM
src/lib/elementary/efl_ui_collection_view.c
1856

I agree, we can calculate the length before creating the request and avoid one allocation cycle for nothing completely.

lauromoura updated this revision to Diff 25704.Thu, Sep 26, 8:45 AM

Updated by moving the variables and calculations used only in VIEWPORT_ENABLE actually inside the ifdef

cedric requested changes to this revision.Thu, Sep 26, 4:00 PM

Ah no, this is incorrect. The idea is to refetch all the object after the deleted one. This patch seems to disable that completely.

This revision now requires changes to proceed.Thu, Sep 26, 4:00 PM
lauromoura updated this revision to Diff 25757.Fri, Sep 27, 7:19 AM

Update by only allocating the request if it will actually be used.

cedric requested changes to this revision.Thu, Oct 10, 3:55 PM
cedric added inline comments.
src/lib/elementary/efl_ui_collection_view.c
1857

In efl we tend to declare variable at the top of the function.

1863

Couldn't this be request_length?

This revision now requires changes to proceed.Thu, Oct 10, 3:55 PM

Update after cedric's comments.

cedric accepted this revision.Fri, Oct 11, 10:56 AM
This revision is now accepted and ready to land.Fri, Oct 11, 10:56 AM
This revision was automatically updated to reflect the committed changes.