---

** [tickets:#2344] log: leak memory in unix domain socket destination handler**

**Status:** assigned
**Milestone:** 5.2.RC1
**Created:** Sun Mar 05, 2017 05:41 PM UTC by Vu Minh Nguyen
**Last Updated:** Sun Mar 05, 2017 05:41 PM UTC
**Owner:** Vu Minh Nguyen


When updating the data store in the configuration handler a dynamic buffer is 
used. Data is added to this buffer using function lgs_cfgupd_list_create() 
which is also used by the help function lgs_cfgupd_mutival_replace(). When the 
buffer is created and expanded when adding more attributes memory is allocated 
that must be freed when the buffer is no longer used. 

In function `void DestinationHandler::UpdateRtDestStatus()`, it uses 
`lgs_cfgupd_mutival_replace()` to update `logRecordDestinationStatus` but not 
freeing buffer at the end of the function.

The allocated buffer needs to be freed by following code line:

```C
  // Free memory allocated for the config_data buffer
  if (config_data.ckpt_buffer_ptr != NULL)
    free(config_data.ckpt_buffer_ptr);
```
 



---

Sent from sourceforge.net because opensaf-tickets@lists.sourceforge.net is 
subscribed to https://sourceforge.net/p/opensaf/tickets/

To unsubscribe from further messages, a project admin can change settings at 
https://sourceforge.net/p/opensaf/admin/tickets/options.  Or, if this is a 
mailing list, you can unsubscribe from the mailing list.
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Opensaf-tickets mailing list
Opensaf-tickets@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-tickets

Reply via email to