• Will Thompson's avatar
    gio-test: fix leak & maybe-uninitialized warning · b45d911c
    Will Thompson authored
    GCC 8 on F29 complains:
    
    ../tests/gio-test.c: In function ‘main’:
    ../tests/gio-test.c:375:7: warning: ‘id’ may be used uninitialized in this function [-Wmaybe-uninitialized]
           g_free (id);
           ^~~~~~~~~~~
    
    In the normal case, when run without arguments, 'id' will be assigned
    exactly once, so all is fine. If run with argument '0', 'id' will never
    be assigned, so the warning is legit; but in that case the test program
    will never exit. If run with any argument greater than 1, 'id' will be
    assigned more than once but only the last incarnation will be freed.
    
    Tweak the scope of the variable to match its use, and arrange for it to
    be freed when its watch is destroyed.
    b45d911c
Name
Last commit
Last update
..
collate Loading commit data...
gobject Loading commit data...
refcount Loading commit data...
.gitignore Loading commit data...
Makefile.am Loading commit data...
assert-msg-test.c Loading commit data...
assert-msg-test.gdb Loading commit data...
asyncqueue-test.c Loading commit data...
atomic-test.c Loading commit data...
bit-test.c Loading commit data...
casefold.txt Loading commit data...
casemap.txt Loading commit data...
child-test.c Loading commit data...
completion-test.c Loading commit data...
cxx-test.cpp Loading commit data...
datetime.c Loading commit data...
dirname-test.c Loading commit data...
env-test.c Loading commit data...
file-test.c Loading commit data...
gen-casefold-txt.py Loading commit data...
gen-casemap-txt.py Loading commit data...
gio-test.c Loading commit data...
iochannel-test-infile Loading commit data...
iochannel-test.c Loading commit data...
libmoduletestplugin_a.c Loading commit data...
libmoduletestplugin_b.c Loading commit data...
mainloop-test.c Loading commit data...
mapping-test.c Loading commit data...
memchunks.c Loading commit data...
meson.build Loading commit data...
module-test.c Loading commit data...
onceinit.c Loading commit data...
qsort-test.c Loading commit data...
relation-test.c Loading commit data...
run-assert-msg-test.sh Loading commit data...
run-collate-tests.sh Loading commit data...
slice-color.c Loading commit data...
slice-concurrent.c Loading commit data...
slice-test.c Loading commit data...
slice-threadinit.c Loading commit data...
sources.c Loading commit data...
spawn-test-win32-gui.c Loading commit data...
spawn-test.c Loading commit data...
testgdate.c Loading commit data...
testgdateparser.c Loading commit data...
testglib.c Loading commit data...
thread-test.c Loading commit data...
threadpool-test.c Loading commit data...
timeloop-basic.c Loading commit data...
timeloop.c Loading commit data...
type-test.c Loading commit data...
unicode-caseconv.c Loading commit data...
unicode-collate.c Loading commit data...
unicode-encoding.c Loading commit data...
unicode-normalize.c Loading commit data...
utf8.txt Loading commit data...