libvirt/src/storage
Eric Blake d95488dce5 security, storage: plug memory leaks for security_context_t
security_context_t happens to be a typedef for char*, and happens to
begin with a string usable as a raw context string.  But in reality,
it is an opaque type that may or may not have additional information
after the first NUL byte, where that additional information can
include pointers that can only be freed via freecon().

Proof is from this valgrind run of daemon/libvirtd:

==6028== 839,169 (40 direct, 839,129 indirect) bytes in 1 blocks are definitely lost in loss record 274 of 274
==6028==    at 0x4A0515D: malloc (vg_replace_malloc.c:195)
==6028==    by 0x3022E0D48C: selabel_open (label.c:165)
==6028==    by 0x3022E11646: matchpathcon_init_prefix (matchpathcon.c:296)
==6028==    by 0x3022E1190D: matchpathcon (matchpathcon.c:317)
==6028==    by 0x4F9D842: SELinuxRestoreSecurityFileLabel (security_selinux.c:382)

800k is a lot of memory to be leaking.

* src/storage/storage_backend.c
(virStorageBackendUpdateVolTargetInfoFD): Avoid leak on error.
* src/security/security_selinux.c
(SELinuxReserveSecurityLabel, SELinuxGetSecurityProcessLabel)
(SELinuxRestoreSecurityFileLabel): Use correct function to free
security_context_t.
2010-11-24 15:23:43 -07:00
..
parthelper.c maint: improve i18n on non-Linux 2010-11-17 10:12:57 -07:00
storage_backend_disk.c maint: use gnulib configmake rather than open-coding things 2010-11-17 08:58:58 -07:00
storage_backend_disk.h build: consistently indent preprocessor directives 2010-03-09 19:22:28 +01:00
storage_backend_fs.c Check whether pools are already active upon libvirtd startup 2010-11-23 15:00:35 +00:00
storage_backend_fs.h build: consistently indent preprocessor directives 2010-03-09 19:22:28 +01:00
storage_backend_iscsi.c Check whether pools are already active upon libvirtd startup 2010-11-23 15:00:35 +00:00
storage_backend_iscsi.h build: consistently indent preprocessor directives 2010-03-09 19:22:28 +01:00
storage_backend_logical.c Check whether pools are already active upon libvirtd startup 2010-11-23 15:00:35 +00:00
storage_backend_logical.h build: consistently indent preprocessor directives 2010-03-09 19:22:28 +01:00
storage_backend_mpath.c Check whether pools are already active upon libvirtd startup 2010-11-23 15:00:35 +00:00
storage_backend_mpath.h build: consistently indent preprocessor directives 2010-03-09 19:22:28 +01:00
storage_backend_scsi.c Improve SCSI volume name generation 2010-11-23 15:00:35 +00:00
storage_backend_scsi.h build: consistently indent preprocessor directives 2010-03-09 19:22:28 +01:00
storage_backend.c security, storage: plug memory leaks for security_context_t 2010-11-24 15:23:43 -07:00
storage_backend.h Check whether pools are already active upon libvirtd startup 2010-11-23 15:00:35 +00:00
storage_driver.c Fix error codes returned when a storage pool is inactive 2010-11-23 15:00:35 +00:00
storage_driver.h build: consistently indent preprocessor directives 2010-03-09 19:22:28 +01:00