[Asterisk-code-review] media_cache: Don't lock when curl the remote file (asterisk[master])

Joshua Colp asteriskteam at digium.com
Mon Aug 16 11:35:29 CDT 2021


Attention is currently required from: Andre Barbosa, Kevin Harwell.
Joshua Colp has posted comments on this change. ( https://gerrit.asterisk.org/c/asterisk/+/16233 )

Change subject: media_cache: Don't lock when curl the remote file
......................................................................


Patch Set 2: Code-Review-1

(2 comments)

File main/media_cache.c:

https://gerrit.asterisk.org/c/asterisk/+/16233/comment/c425a764_204dc57d 
PS2, Line 210: 	bucket_file = ao2_find(media_cache, uri, OBJ_SEARCH_KEY | OBJ_NOLOCK);
This logic doesn't appear to be correct. You retrieve bucket_file above, then overwrite the pointer causing a leak. The subsequent code would also not work properly, as it is only executed when bucket_file is NULL.


https://gerrit.asterisk.org/c/asterisk/+/16233/comment/b586b448_9036273a 
PS2, Line 212: 		ao2_ref(bucket_file, -1);
As well when this logic is fixed - I believe you need to call ast_bucket_file_delete on what was retrieved from ast_bucket_file_retrieve or the file won't go away.



-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/16233
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Change-Id: I8d4142b463ae4a1d4c41bff2bf63324821567408
Gerrit-Change-Number: 16233
Gerrit-PatchSet: 2
Gerrit-Owner: Andre Barbosa <andre.emanuel.barbosa at gmail.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: Joshua Colp <jcolp at sangoma.com>
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
Gerrit-Attention: Andre Barbosa <andre.emanuel.barbosa at gmail.com>
Gerrit-Attention: Kevin Harwell <kharwell at digium.com>
Gerrit-Comment-Date: Mon, 16 Aug 2021 16:35:29 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20210816/ed1f644c/attachment-0001.html>


More information about the asterisk-code-review mailing list