Project

General

Profile

Actions

Bug #6167

closed

libshare_nfs: Possible memory leak in configlog()

Added by Marcel Telka almost 6 years ago. Updated almost 6 years ago.

Status:
Closed
Priority:
Low
Assignee:
Category:
nfs - NFS server and client
Start date:
2015-08-27
Due date:
% Done:

100%

Estimated time:
Difficulty:
Bite-size
Tags:
needs-triage
Gerrit CR:

Description

While walking through the code I noticed the following in libshare_nfs.c:

897        if (exp->ex_flags != NULL)
898            free(exp->ex_tag);
899        if (exp->ex_log_buffer != NULL)
900            free(exp->ex_log_buffer);

The author of the code very likely wanted to use exp->ex_tag instead of exp->ex_flags at line 897. With the current code in a case the ex_flags is zero and ex_tag is non-null we will see a leak.

To fix this issue the code above could be safely changed to:

897        free(exp->ex_tag);
898        free(exp->ex_log_buffer);
Actions

Also available in: Atom PDF