diff --git a/lib/dialects/sun/dnode.c b/lib/dialects/sun/dnode.c index b1d50e94..db33d1dc 100644 --- a/lib/dialects/sun/dnode.c +++ b/lib/dialects/sun/dnode.c @@ -3431,7 +3431,8 @@ void process_node(struct lsof_context *ctx, /* context */ * Set the file system device to the file system type and clear * the doubtful device numbers. */ - Lf->fsdev = Fsinfo[fx]; + /* Like other fsdev values, this must be owned by the file. */ + Lf->fsdev = mkstrcpy(Fsinfo[fx], (MALLOC_S *)NULL); devs = 0; rdevs = 0; } diff --git a/lib/lsof.c b/lib/lsof.c index e74652d3..94308d0e 100644 --- a/lib/lsof.c +++ b/lib/lsof.c @@ -431,8 +431,11 @@ enum lsof_error lsof_gather(struct lsof_context *ctx, for (lf = lp->file; lf; lf = lf_next) { /* free lf */ lf_next = lf->next; + CLEAN(lf->nm); /* selected names were transferred to the result */ CLEAN(lf->nma); CLEAN(lf->dev_ch); + CLEAN(lf->fsdir); + CLEAN(lf->fsdev); #if defined(CLRLFILEADD) CLRLFILEADD(lf) #endif /* defined(CLRLFILEADD) */