Project

General

Profile

Bug #6167

libshare_nfs: Possible memory leak in configlog()

Added by Marcel Telka over 5 years ago. Updated over 5 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);
#1

Updated by Marcel Telka over 5 years ago

  • Subject changed from libshare_nfs: Possible memory leak configlog(_ to libshare_nfs: Possible memory leak in configlog()
  • Description updated (diff)
  • Category set to nfs - NFS server and client
  • Priority changed from Normal to Low
  • Difficulty changed from Medium to Bite-size
#2

Updated by Marcel Telka over 5 years ago

  • Assignee set to Marcel Telka
  • Status changed from New to In Progress
#3

Updated by Marcel Telka over 5 years ago

  • Status changed from In Progress to Pending RTI
#4

Updated by Electric Monk over 5 years ago

  • Status changed from Pending RTI to Closed
  • % Done changed from 0 to 100

git commit 822e63878c940bbf8d5d6fe9d475446e13485b7d

commit  822e63878c940bbf8d5d6fe9d475446e13485b7d
Author: Marcel Telka <marcel.telka@nexenta.com>
Date:   2015-08-31T15:24:29.000Z

    6167 libshare_nfs: Possible memory leak in configlog()
    Reviewed by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
    Reviewed by: Dan McDonald <danmcd@omniti.com>
    Approved by: Robert Mustacchi <rm@joyent.com>

Also available in: Atom PDF