summaryrefslogtreecommitdiff
path: root/src/basic/util.c
diff options
context:
space:
mode:
authorDaniel Mack <github@zonque.org>2015-10-20 10:31:38 +0200
committerDaniel Mack <github@zonque.org>2015-10-20 10:31:38 +0200
commit824b35c3859bc99b97ac5fa6e09aa34627e9bcd5 (patch)
tree266c8f9988ba8d1cab00a55b360b3f2e42096dde /src/basic/util.c
parentec566e4c7cee67ec2c39475ef08f18a9f1b80efd (diff)
parent2229f656677f0d50c507aec40cda59f66da5c949 (diff)
Merge pull request #1568 from poettering/netclass
various fixes, for various things
Diffstat (limited to 'src/basic/util.c')
-rw-r--r--src/basic/util.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/basic/util.c b/src/basic/util.c
index 2565b0f547..a14ed2e4cc 100644
--- a/src/basic/util.c
+++ b/src/basic/util.c
@@ -6805,3 +6805,22 @@ bool fdname_is_valid(const char *s) {
bool oom_score_adjust_is_valid(int oa) {
return oa >= OOM_SCORE_ADJ_MIN && oa <= OOM_SCORE_ADJ_MAX;
}
+
+void string_erase(char *x) {
+
+ if (!x)
+ return;
+
+ /* A delicious drop of snake-oil! To be called on memory where
+ * we stored passphrases or so, after we used them. */
+
+ memory_erase(x, strlen(x));
+}
+
+char *string_free_erase(char *s) {
+ if (!s)
+ return NULL;
+
+ string_erase(s);
+ return mfree(s);
+}