]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
lsipc: value is never read [clang analyze]
authorKarel Zak <kzak@redhat.com>
Wed, 29 Jul 2015 11:54:54 +0000 (13:54 +0200)
committerKarel Zak <kzak@redhat.com>
Wed, 29 Jul 2015 11:54:54 +0000 (13:54 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
sys-utils/lsipc.c

index 045c0e8c10f566f5d99949c7e624fd4dbdad5d48..a30dcbd6cedf6256488b351c0d2dd8fd19a6db5f 100644 (file)
@@ -1013,7 +1013,8 @@ static void do_shm(int id, struct lsipc_control *ctl, struct libscols_table *tb)
                        case COL_STATUS: {
                                        int comma = 0;
                                        size_t offt = 0;
-                                       free (arg);
+
+                                       free(arg);
                                        arg = xcalloc(1, sizeof(char) * strlen(_("dest"))
                                                        + strlen(_("locked"))
                                                        + strlen(_("hugetlb"))
@@ -1036,7 +1037,7 @@ static void do_shm(int id, struct lsipc_control *ctl, struct libscols_table *tb)
                                        if (shmdsp->shm_perm.mode & SHM_NORESERVE) {
                                                if (comma)
                                                        arg[offt++] = ',';
-                                               offt += sprintf(arg + offt, "%s", _("noreserve"));
+                                               sprintf(arg + offt, "%s", _("noreserve"));
                                        }
                                        rc = scols_line_set_data(ln, n, arg);
                                }