Message ID | 1422270747-23994-4-git-send-email-pbonzini@redhat.com |
---|---|
State | New |
Headers | show |
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; }
Detected by Coverity. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> --- util/uri.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)