diff options
author | markj <markj@FreeBSD.org> | 2017-06-29 17:29:07 +0000 |
---|---|---|
committer | markj <markj@FreeBSD.org> | 2017-06-29 17:29:07 +0000 |
commit | 3e28ccad1fda3d5ef7322be424a03439627ecf61 (patch) | |
tree | 5dc9903ce893e3e1338fefff8680a47892410841 /sys | |
parent | b57cbade9376fa27d6bcb3f21e97a8cf822cd3cf (diff) | |
download | FreeBSD-src-3e28ccad1fda3d5ef7322be424a03439627ecf61.zip FreeBSD-src-3e28ccad1fda3d5ef7322be424a03439627ecf61.tar.gz |
MFC r320372:
Fix a memory leak in ses_get_elm_devnames().
Diffstat (limited to 'sys')
-rw-r--r-- | sys/cam/scsi/scsi_enc_ses.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/cam/scsi/scsi_enc_ses.c b/sys/cam/scsi/scsi_enc_ses.c index 042129f..854ec51 100644 --- a/sys/cam/scsi/scsi_enc_ses.c +++ b/sys/cam/scsi/scsi_enc_ses.c @@ -2687,10 +2687,11 @@ ses_get_elm_devnames(enc_softc_t *enc, encioc_elm_devnames_t *elmdn) cam_periph_unlock(enc->periph); sbuf_new(&sb, NULL, len, SBUF_FIXEDLEN); ses_paths_iter(enc, &enc->enc_cache.elm_map[elmdn->elm_idx], - ses_elmdevname_callback, &sb); + ses_elmdevname_callback, &sb); sbuf_finish(&sb); elmdn->elm_names_len = sbuf_len(&sb); copyout(sbuf_data(&sb), elmdn->elm_devnames, elmdn->elm_names_len + 1); + sbuf_delete(&sb); cam_periph_lock(enc->periph); return (elmdn->elm_names_len > 0 ? 0 : ENODEV); } |