diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2015-03-17 11:43:00 +0000 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2015-03-17 11:43:00 +0000 |
commit | 5a4992834daec85c3913654903fb9f4f954e585a (patch) | |
tree | d52db43c8d3c23cfc22a6856517e5c7b3702fcf4 | |
parent | 494a864e055b565182dcdd3807c1f09a211d0fc5 (diff) | |
parent | 906b8bab8bbc588f19752ed19e0222330dce31f9 (diff) |
Merge remote-tracking branch 'remotes/armbru/tags/pull-cov-model-2015-03-17' into staging
coverity: Fix g_malloc_n-like models
# gpg: Signature made Tue Mar 17 10:17:56 2015 GMT using RSA key ID EB918653
# gpg: Good signature from "Markus Armbruster <armbru@redhat.com>"
# gpg: aka "Markus Armbruster <armbru@pond.sub.org>"
* remotes/armbru/tags/pull-cov-model-2015-03-17:
coverity: Fix g_malloc_n-like models
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
-rw-r--r-- | scripts/coverity-model.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/scripts/coverity-model.c b/scripts/coverity-model.c index 58356afa66..cdda2591d9 100644 --- a/scripts/coverity-model.c +++ b/scripts/coverity-model.c @@ -123,7 +123,7 @@ void *g_malloc_n(size_t nmemb, size_t size) __coverity_negative_sink__(nmemb); __coverity_negative_sink__(size); sz = nmemb * size; - ptr = __coverity_alloc__(size); + ptr = __coverity_alloc__(sz); __coverity_mark_as_uninitialized_buffer__(ptr); __coverity_mark_as_afm_allocated__(ptr, "g_free"); return ptr; @@ -137,7 +137,7 @@ void *g_malloc0_n(size_t nmemb, size_t size) __coverity_negative_sink__(nmemb); __coverity_negative_sink__(size); sz = nmemb * size; - ptr = __coverity_alloc__(size); + ptr = __coverity_alloc__(sz); __coverity_writeall0__(ptr); __coverity_mark_as_afm_allocated__(ptr, "g_free"); return ptr; @@ -151,7 +151,7 @@ void *g_realloc_n(void *ptr, size_t nmemb, size_t size) __coverity_negative_sink__(size); sz = nmemb * size; __coverity_escape__(ptr); - ptr = __coverity_alloc__(size); + ptr = __coverity_alloc__(sz); /* * Memory beyond the old size isn't actually initialized. Can't * model that. See Coverity's realloc() model |