diff options
author | 2014-12-13 10:31:07 +0000 | |
---|---|---|
committer | 2014-12-13 10:31:07 +0000 | |
commit | 71847ebdc6411ce9154e1448ea3120fd6a57b2a0 (patch) | |
tree | 684ef80b5eab3290107c724e2983e5f59d1cd4d2 /usr.bin/patch/util.h | |
parent | macro cleanup; from Kaspars Bankovskis, tweaked a bit (diff) | |
download | wireguard-openbsd-71847ebdc6411ce9154e1448ea3120fd6a57b2a0.tar.xz wireguard-openbsd-71847ebdc6411ce9154e1448ea3120fd6a57b2a0.zip |
The function savestr allows NULL return values during Plan A patching so in
case of out of memory conditions, Plan B can step in. In many cases, NULL
value is not properly handled, so use xstrdup here (it's outside Plan A/B
patching, which means that even Plan B relies on successful operations).
Diffstat (limited to 'usr.bin/patch/util.h')
-rw-r--r-- | usr.bin/patch/util.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/usr.bin/patch/util.h b/usr.bin/patch/util.h index b27bbe3cc3a..5cd0ba84057 100644 --- a/usr.bin/patch/util.h +++ b/usr.bin/patch/util.h @@ -1,4 +1,4 @@ -/* $OpenBSD: util.h,v 1.15 2005/06/20 07:14:06 otto Exp $ */ +/* $OpenBSD: util.h,v 1.16 2014/12/13 10:31:07 tobias Exp $ */ /* * patch - a program to apply diffs to original files @@ -40,6 +40,7 @@ void pfatal(const char *, ...) void ask(const char *, ...) __attribute__((__format__(__printf__, 1, 2))); char *savestr(const char *); +char *xstrdup(const char *); void set_signals(int); void ignore_signals(void); void makedirs(const char *, bool); |