Skip to content

Commit 8d75d0a

Browse files
Merge pull request #131 from jeffhostetler/gvfs-fix-ci-static-analysis
Fix CI static analysis
2 parents 11966f8 + 0d1452f commit 8d75d0a

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

builtin/commit.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,10 @@ static int opt_parse_serialize(const struct option *opt, const char *arg, int un
171171
if (unset || !arg)
172172
*value = STATUS_FORMAT_SERIALIZE_V1;
173173

174-
if (arg)
174+
if (arg) {
175+
free(serialize_path);
175176
serialize_path = xstrdup(arg);
177+
}
176178

177179
if (do_explicit_deserialize)
178180
die("cannot mix --serialize and --deserialize");
@@ -200,8 +202,11 @@ static int opt_parse_deserialize(const struct option *opt, const char *arg, int
200202
} else {
201203
if (do_serialize)
202204
die("cannot mix --serialize and --deserialize");
203-
if (arg) /* override config or stdin */
205+
if (arg) {
206+
/* override config or stdin */
207+
free(deserialize_path);
204208
deserialize_path = xstrdup(arg);
209+
}
205210
if (deserialize_path && *deserialize_path
206211
&& (wt_status_deserialize_access(deserialize_path, R_OK) != 0))
207212
die("cannot find serialization file '%s'",

wt-status-deserialize.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -677,7 +677,7 @@ static int wt_deserialize_fd(const struct wt_status *cmd_s, struct wt_status *de
677677
return DESERIALIZE_ERR;
678678
}
679679
/* status_format */
680-
if (hashcmp(cmd_s->sha1_commit, des_s->sha1_commit)) {
680+
if (!hasheq(cmd_s->sha1_commit, des_s->sha1_commit)) {
681681
set_deserialize_reject_reason("args/commit-changed");
682682
trace_printf_key(&trace_deserialize, "reject: sha1_commit");
683683
return DESERIALIZE_ERR;

0 commit comments

Comments
 (0)