]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib: str_free(NULL) should be a no-op
authorJosef 'Jeff' Sipek <jeff.sipek@dovecot.fi>
Thu, 9 Nov 2017 15:32:32 +0000 (10:32 -0500)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Mon, 12 Mar 2018 09:58:53 +0000 (11:58 +0200)
src/lib/str.c

index 5af92f43ddf0fb08ef003e136a86d61f15255bd8..af2c24807b4d2c87c36fe9beb6b116b06e96c17c 100644 (file)
@@ -39,6 +39,9 @@ string_t *t_str_new_const(const char *str, size_t len)
 
 void str_free(string_t **str)
 {
+       if (str == NULL || *str == NULL)
+               return;
+
        buffer_free(str);
 }