#48398 Coverity defect 13352 - Resource leak in auditlog.c
Closed: Fixed None Opened 4 years ago by firstyear.

  1. Condition config_get_auditfaillog() == NULL, taking false branch
  2. alloc_fn: Storage is returned from allocation function config_get_auditfaillog. [show details]
  3. noescape: Resource config_get_auditfaillog() is not freed or pointed-to in strlen.
  4. Condition strlen(config_get_auditfaillog()) == 0, taking true branch
    CID 13352 (#1 of 1): Resource leak (RESOURCE_LEAK)8. leaked_storage: Failing to save or free storage allocated by config_get_auditfaillog() leaks it.
    132 if (config_get_auditfaillog() == NULL || strlen(config_get_auditfaillog()) == 0) {

config_get_auditfaillog allocates a char* ptr and returns it. This if statement doesn't free that.


You don't need to check for NULL before calling:

{{{
slapi_ch_free_string(&auditfail_config);
}}}

commit 24c7896

Total 27 (delta 21), reused 0 (delta 0)
To ssh://git.fedorahosted.org/git/389/ds.git
ab6501a..aa20634 master -> master

Metadata Update from @firstyear:
- Issue assigned to firstyear
- Issue set to the milestone: 1.3.5 backlog

3 years ago

Login to comment on this ticket.

Metadata