]> mj.ucw.cz Git - pciutils.git/blobdiff - lib/names-cache.c
Update license comments and added SPDX license identifiers
[pciutils.git] / lib / names-cache.c
index 90a6454a2c91781d9b331b82e165a0e5d9bc00b3..65bfb85acbc5bf76e70bd5515b0fa08f9efc1b62 100644 (file)
@@ -3,7 +3,9 @@
  *
  *     Copyright (c) 2008--2009 Martin Mares <mj@ucw.cz>
  *
- *     Can be freely distributed and used under the terms of the GNU GPL.
+ *     Can be freely distributed and used under the terms of the GNU GPL v2+.
+ *
+ *     SPDX-License-Identifier: GPL-2.0-or-later
  */
 
 #include "internal.h"
@@ -38,8 +40,9 @@ static char *get_cache_name(struct pci_access *a)
 
   buf = pci_malloc(a, strlen(pw->pw_dir) + strlen(name+1) + 1);
   sprintf(buf, "%s%s", pw->pw_dir, name+1);
-  pci_set_param_internal(a, "net.cache_name", buf, 0);
-  return buf;
+  pci_set_param_internal(a, "net.cache_name", buf, 1);
+  pci_mfree(buf);
+  return pci_get_param(a, "net.cache_name");
 }
 
 int