• M
    coverity: Model GLib string allocation partially · e4b77daa
    Markus Armbruster 提交于
    Without a model, Coverity can't know that the result of g_strdup()
    needs to be fed to g_free().
    
    One way to get such a model is to scan GLib, build a derived model
    file with cov-collect-models, and use that when scanning QEMU.
    Unfortunately, the Coverity Scan service we use doesn't support that.
    
    Thus, we're stuck with the other way: write a user model.  Doing that
    for all of GLib is hardly practical.  I'm doing it for the "String
    Utility Functions" we actually use that return dynamically allocated
    strings.
    
    In a local scan, this flags 20 additional RESOURCE_LEAKs.  The ones I
    checked look genuine.
    
    It also loses a NULL_RETURNS about ppce500_init() using
    qemu_find_file() without error checking.  I don't understand why.
    Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
    Acked-by: NPaolo Bonzini <pbonzini@redhat.com>
    e4b77daa
coverity-model.c 7.6 KB