From: Christian Grothoff Date: Mon, 7 Nov 2011 18:43:40 +0000 (+0000) Subject: fix #1885 X-Git-Tag: initial-import-from-subversion-38251~16010 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=174ab5aba2bdfde8a4614bf0069a33a7bbe57ce7;p=oweals%2Fgnunet.git fix #1885 --- diff --git a/src/util/strings.c b/src/util/strings.c index dc4037a1f..58a4847bc 100644 --- a/src/util/strings.c +++ b/src/util/strings.c @@ -236,11 +236,15 @@ GNUNET_STRINGS_fancy_size_to_bytes (const char *fancy_size, ret += last; last = 0; if (1 != sscanf (tok, "%llu", &last)) + { + GNUNET_free (in); return GNUNET_SYSERR; /* expected number */ + } } } ret += last; *size = ret; + GNUNET_free (in); return GNUNET_OK; } @@ -311,11 +315,15 @@ GNUNET_STRINGS_fancy_time_to_relative (const char *fancy_size, ret += last; last = 0; if (1 != sscanf (tok, "%llu", &last)) + { + GNUNET_free (in); return GNUNET_SYSERR; /* expected number */ + } } } ret += last; rtime->rel_value = (uint64_t) ret; + GNUNET_free (in); return GNUNET_OK; }