Hi,

this is another one of the High impact defects that has a simple fix and
where I'm not sure if this is really the intended behavior. All the code
that uses work_items points to this solution which seems strange because
it creates a new DB_WORK_ITEM object, copies it into the vector and then
destroys the original object. The alternative would be to have a vector
of pointers to DB_WORK_ITEM objects but for this, one has to change the
code in scan_work_array() too.

I tested this with a small program that mimics this part of the feeder
code to run it with Valgrind and the change fixes the memory leak and
doesn't break the functionality.

Regards
Christian


-------- Forwarded Message --------
Subject:        [boinc_cvs] [BOINC/boinc] 770fbf: Feeder: prevent resource leak
Date:   Mon, 09 Nov 2015 09:14:18 -0800
From:   GitHub <[email protected]>
Reply-To:       GitHub <[email protected]>
To:     [email protected]



  Branch: refs/heads/fix_defects_server
  Home:   https://github.com/BOINC/boinc
  Commit: 770fbf138f4e09d02c657719215abb91fe76c163
      
https://github.com/BOINC/boinc/commit/770fbf138f4e09d02c657719215abb91fe76c163
  Author: Christian Beer <[email protected]>
  Date:   2015-11-09 (Mon, 09 Nov 2015)

  Changed paths:
    M sched/feeder.cpp

  Log Message:
  -----------
  Feeder: prevent resource leak

I confirmed the leak using Valgrind and tested the fix with a simple program 
using the same workflow as the feeder.
fixes CID 27760 found by Coverity





_______________________________________________
boinc_dev mailing list
[email protected]
http://lists.ssl.berkeley.edu/mailman/listinfo/boinc_dev
To unsubscribe, visit the above URL and
(near bottom of page) enter your email address.

Reply via email to