summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormarkj <markj@FreeBSD.org>2017-06-29 17:34:48 +0000
committermarkj <markj@FreeBSD.org>2017-06-29 17:34:48 +0000
commit412877667897dfb62a7df77d89f057251d2418bc (patch)
treebab6b7b09f5b717259bfcaa9157a6de9e99bfffe
parentee49cfe1b1919323a8df1d74c38b41d78ca7d892 (diff)
downloadFreeBSD-src-412877667897dfb62a7df77d89f057251d2418bc.zip
FreeBSD-src-412877667897dfb62a7df77d89f057251d2418bc.tar.gz
MFC r320372:
Fix a memory leak in ses_get_elm_devnames(). Approved by: re (gjb)
-rw-r--r--sys/cam/scsi/scsi_enc_ses.c3
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 7f931b4..2aee34b 100644
--- a/sys/cam/scsi/scsi_enc_ses.c
+++ b/sys/cam/scsi/scsi_enc_ses.c
@@ -2684,10 +2684,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);
}
OpenPOWER on IntegriCloud