summaryrefslogtreecommitdiffstats
path: root/util/path.c
Commit message (Collapse)AuthorAgeFilesLines
* util/path: Use the GLib memory allocation routineszhanghailiang2014-08-241-5/+5
| | | | | | | | | | | In this file, we don't check the return value of malloc/strdup/realloc which may fail. Instead of using these routines, we use the GLib memory APIs g_malloc/g_strdup/g_realloc. They will exit on allocation failure, so there is no need to test for failure, which would be fine for setup. Signed-off-by: zhanghailiang <zhang.zhanghailiang@huawei.com> Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
* init_paths: fix minor memory leakKirill Batuzov2014-04-281-1/+3
| | | | | | | | | Fields "name" (created with strdup in new_entry) and "pathname" (created with g_strdup_printf in new_entry) of pathelem struct should be freed before the whole struct is. Signed-off-by: Kirill Batuzov <batuzovk@ispras.ru> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
* util/path: Fix type which is longer than 8 bit for MinGWStefan Weil2013-10-051-2/+2
| | | | | | | | | | | | | | While dirent->d_type is 8 bit for most systems, it is 32 bit for MinGW. Reducing it to 8 bit results in a compiler warning because the macro is_dir_maybe compares that 8 bit value with 32 bit constants. Using 'unsigned' instead of 'unsigned char' matches the declaration for MinGW and does not harm the other systems. MinGW-w64 is not affected: it does not declare d_type. Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
* Replace non-portable asprintf by g_strdup_printfStefan Weil2013-01-191-4/+1
| | | | | | | | g_strdup_printf already handles OOM errors, so some error handling in QEMU code can be removed. Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* build: move libqemuutil.a components to util/Paolo Bonzini2013-01-121-0/+182
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
OpenPOWER on IntegriCloud