mirror of
https://github.com/git/git.git
synced 2025-12-12 20:36:24 +01:00
cocci: refactor common patterns to use xstrdup_or_null()
d64ea0f83b ("git-compat-util: add xstrdup_or_null helper",
2015-01-12) added a handy wrapper that allows us to get a duplicate
of a string or NULL if the original is NULL, but a handful of
codepath predate its introduction or just weren't aware of it.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
@@ -181,8 +181,7 @@ static int receive_status(int in, struct ref *refs)
|
||||
hint->status = REF_STATUS_REMOTE_REJECT;
|
||||
ret = -1;
|
||||
}
|
||||
if (msg)
|
||||
hint->remote_status = xstrdup(msg);
|
||||
hint->remote_status = xstrdup_or_null(msg);
|
||||
/* start our next search from the next ref */
|
||||
hint = hint->next;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user