mirror of
https://github.com/systemd/systemd.git
synced 2026-08-03 06:30:30 +00:00
nspawn-oci: add helper function for free_and_strdup with oom check
This commit is contained in:
@@ -180,6 +180,11 @@ char *strrep(const char *s, unsigned n);
|
||||
int split_pair(const char *s, const char *sep, char **l, char **r);
|
||||
|
||||
int free_and_strdup(char **p, const char *s);
|
||||
static inline int free_and_strdup_warn(char **p, const char *s) {
|
||||
if (free_and_strdup(p, s) < 0)
|
||||
return log_oom();
|
||||
return 0;
|
||||
}
|
||||
int free_and_strndup(char **p, const char *s, size_t l);
|
||||
|
||||
char *string_erase(char *x);
|
||||
|
||||
Reference in New Issue
Block a user