[Bug 1592999] Re: memory leak in libmultipath

Dragan S. 1592999 at bugs.launchpad.net
Tue Jul 5 20:21:22 UTC 2016


After analysis this turns out not to be a bug, the code at the top of
get_uid calls select_getuid which calls pp_set_ovr(uid_attribute). That
macro points uid_attribute into the global config variable that lives
beyond this function call. So no need for get_uid to free it.

** Changed in: multipath-tools (Ubuntu)
       Status: New => Invalid

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to multipath-tools in Ubuntu.
https://bugs.launchpad.net/bugs/1592999

Title:
  memory leak in libmultipath

Status in multipath-tools package in Ubuntu:
  Invalid

Bug description:
  Description:	Ubuntu 16.04 LTS
  Release:	16.04

  
  get_uid in libmultipath appears to be leaking memory on the error path.

  1553                 if (len <= 0 &&
  1554                     !strcmp(pp->uid_attribute, DEFAULT_UID_ATTRIBUTE)) {
  1555                         len = get_vpd_uid(pp);
  1556                         origin = "sysfs";
  1557                         pp->uid_attribute = NULL;
  1558                         if (len < 0) {
  1559                                 condlog(1, "%s: failed to get sysfs uid: %s %d",
  1560                                         pp->dev, strerror(-len), line);
  1561                                 len = get_vpd_sgio(pp->fd, 0x83, pp->wwid,
  1562                                                    WWID_SIZE);
  1563                                 origin = "sgio";
  1564                         }
  1565                 }

  Line 1557 resets the uid_attribute to NULL after it was successfully
  compared at line 1554 but it doesn't free the pointer fist.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/multipath-tools/+bug/1592999/+subscriptions



More information about the foundations-bugs mailing list