diff options
author | Rafael G. Martins <rafael@rafaelmartins.eng.br> | 2015-05-10 23:10:10 -0300 |
---|---|---|
committer | Rafael G. Martins <rafael@rafaelmartins.eng.br> | 2015-05-10 23:10:10 -0300 |
commit | f987424ed9954239ec0a730b721700ac58c1bf1a (patch) | |
tree | 702112d8935ab60b62597d3d0a98a492c9313aef /src/utils/strings.c | |
parent | 15d3beecdd227c08df600336dff9ecd2d5979136 (diff) | |
download | blogc-f987424ed9954239ec0a730b721700ac58c1bf1a.tar.gz blogc-f987424ed9954239ec0a730b721700ac58c1bf1a.tar.bz2 blogc-f987424ed9954239ec0a730b721700ac58c1bf1a.zip |
fixed a few issues reported by clang's static analyzer
Diffstat (limited to 'src/utils/strings.c')
-rw-r--r-- | src/utils/strings.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/utils/strings.c b/src/utils/strings.c index 04ccc7a..4a48f6d 100644 --- a/src/utils/strings.c +++ b/src/utils/strings.c @@ -6,6 +6,10 @@ * See the file COPYING. */ +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif /* HAVE_CONFIG_H */ + #include <ctype.h> #include <string.h> #include <stdarg.h> @@ -57,8 +61,10 @@ b_strdup_vprintf(const char *format, va_list ap) if (!tmp) return NULL; int l2 = vsnprintf(tmp, l + 1, format, ap); - if (l2 < 0) + if (l2 < 0) { + free(tmp); return NULL; + } return tmp; } |