From: Jaroslav Kysela Date: Sat, 2 Dec 2017 17:59:36 +0000 (+0100) Subject: url: fix urlcopy() X-Git-Tag: v4.2.5~19 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9ec9b571316c003ccb15fd714cc3b81de9581bde;p=thirdparty%2Ftvheadend.git url: fix urlcopy() --- diff --git a/src/url.c b/src/url.c index 43b1163ef..0d54ced69 100644 --- a/src/url.c +++ b/src/url.c @@ -43,15 +43,15 @@ urlreset ( url_t *url ) void urlcopy ( url_t *dst, const url_t *src ) { - dst->scheme = strdup(src->scheme); - dst->user = strdup(src->user); - dst->pass = strdup(src->pass); - dst->host = strdup(src->host); + dst->scheme = src->scheme ? strdup(src->scheme) : NULL; + dst->user = src->user ? strdup(src->user) : NULL; + dst->pass = src->pass ? strdup(src->pass) : NULL; + dst->host = src->host ? strdup(src->host) : NULL; dst->port = src->port; - dst->path = strdup(src->path); - dst->query = strdup(src->query); - dst->frag = strdup(src->frag); - dst->raw = strdup(src->raw); + dst->path = src->path ? strdup(src->path) : NULL; + dst->query = src->query ? strdup(src->query) : NULL; + dst->frag = src->frag ? strdup(src->frag) : NULL; + dst->raw = src->raw ? strdup(src->raw) : NULL; } /* Use liburiparser if available */