This is primarily to satisfy static analyzers, as memset() is defined
as a non-null function (although it does nothing when bufsiz=0).
Signed-off-by: Karel Zak <kzak@redhat.com>
if (fs->stmnt) {
DBG(FS, ul_debugobj(fs, " reuse libmnt_stmnt"));
- memset(fs->stmnt->buf, 0, fs->stmnt->bufsiz);
+
+ /* note that sys_statmount (re)allocates the buffer */
+ if (fs->stmnt->buf && fs->stmnt->bufsiz > 0)
+ memset(fs->stmnt->buf, 0, fs->stmnt->bufsiz);
rc = ul_statmount(fs->uniq_id, 0, mask,
&fs->stmnt->buf, &fs->stmnt->bufsiz, 0);