3 * Copyright (C) 2014 Red Hat, Inc.
6 * Markus Armbruster <armbru@redhat.com>
7 * Paolo Bonzini <pbonzini@redhat.com>
9 * This work is licensed under the terms of the GNU GPL, version 2 or, at your
10 * option, any later version. See the COPYING file in the top-level directory.
13 * This is the source code for our Coverity user model file. The
14 * purpose of user models is to increase scanning accuracy by explaining
15 * code Coverity can't see (out of tree libraries) or doesn't
16 * sufficiently understand. Better accuracy means both fewer false
17 * positives and more true defects. Memory leaks in particular.
19 * - A model file can't import any header files. Some built-in primitives are
20 * available but not wchar_t, NULL etc.
21 * - Modeling doesn't need full structs and typedefs. Rudimentary structs
22 * and similar types are sufficient.
23 * - An uninitialized local variable signifies that the variable could be
26 * The model file must be uploaded by an admin in the analysis settings of
27 * https://scan.coverity.com/projects/54
29 * above text is based on https://github.com/qemu/qemu/blob/master/scripts/coverity-model.c
32 #define NULL (void *)0
34 // Based on https://scan.coverity.com/models
35 void *av_malloc(size_t size) {
37 __coverity_negative_sink__(size);
39 return __coverity_alloc__(size);