The static analyzer flagged a potential issue: the return value of
mnt_fs_get_target(fs) could be NULL, but it was dereferenced without
a check. This could lead to undefined behavior.
Added a NULL check before using the tgt pointer. If tgt is NULL,
the current iteration is skipped.
ChanChanges:
- Added if (!tgt) check before using tgt.
Signed-off-by: Anton Moryakov <ant.v.moryakov@gmail.com>
const char *tgt = mnt_fs_get_target(fs);
+ if(!tgt)
+ continue;
+
if (!*str)
xasprintf(str, "%s", tgt);