• E
    threads: check for failure to set thread-local value · 927cfaf4
    Eric Blake 提交于
    We had a memory leak on a very arcane OOM situation (unlikely to ever
    hit in practice, but who knows if libvirt.so would ever be linked
    into some other program that exhausts all thread-local storage keys?).
    I found it by code inspection, while analyzing a valgrind report
    generated by Alex Jia.
    
    * src/util/threads.h (virThreadLocalSet): Alter signature.
    * src/util/threads-pthread.c (virThreadHelper): Reduce allocation
    lifetime.
    (virThreadLocalSet): Detect failure.
    * src/util/threads-win32.c (virThreadLocalSet): Likewise.
    (virCondWait): Fix caller.
    * src/util/virterror.c (virLastErrorObject): Likewise.
    927cfaf4
threads-win32.c 8.9 KB