Detected by Coverity. Signed-off-by: Paolo Bonzini <pbonz...@redhat.com> --- util/uri.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/util/uri.c b/util/uri.c index 918d235..014d40d 100644 --- a/util/uri.c +++ b/util/uri.c @@ -1971,7 +1971,9 @@ uri_resolve_relative (const char *uri, const char * base) val = g_strdup (uri); goto done; } - if (!strcmp(bas->path, ref->path)) { + if (bas->path == ref->path || + (bas->path != NULL && ref->path != NULL && + !strcmp(bas->path, ref->path))) { val = g_strdup(""); goto done; } -- 1.8.3.1