[Bugs] [Bug 789278] Issues reported by Coverity static analysis tool

bugzilla at redhat.com bugzilla at redhat.com
Tue Aug 21 05:01:46 UTC 2018


https://bugzilla.redhat.com/show_bug.cgi?id=789278



--- Comment #1355 from Worker Ant <bugzilla-bot at gluster.org> ---
COMMIT: https://review.gluster.org/20652 committed in master by "Amar Tumballi"
<amarts at redhat.com> with a commit message- xlators: protocol: Fix deferencing
pointer after free coverity issues

The pointer of type struct iobuf * is getting dereferenced after
getting freed by iobuf_unref function. Therefore, move this function
after all the dereferences of this pointer type.
Also, it is useful coding standard to have iobuf_unref just after
iobref_add. So, move iobref_add too.

Occurences found using Coccinelle script:
@@
identifier rsphdr_iobuf;
expression E;
identifier func;
@@
*iobuf_unref(rsphdr_iobuf);
...
*E = func(rsphdr_iobuf);

Fixes CID: 1390517, 1390278, 1388666, 1356588, 1356587 at [1].
and also some more occurences which were found using the above script but not
caught by Coverity.
[1].
https://scan6.coverity.com/reports.htm#v42388/p10714/fileInstanceId=84384920&defectInstanceId=25600709&mergedDefectId=1388666

Change-Id: I579e9d12698f14e9e24bc926c6efef16bac5c06c
updates: bz#789278
Signed-off-by: Bhumika Goyal <bgoyal at redhat.com>

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the Bugs mailing list