From 2d6514b509d4cb1e284ccd042cbe00a9380eeb21 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Tue, 19 Feb 2013 08:36:46 +0100 Subject: [PATCH] owncloud: Fix some problems in the owncloud module. Thanks to Patrick Buergi. --- modules/csync_owncloud.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/modules/csync_owncloud.c b/modules/csync_owncloud.c index 80fe388992..4955461b5f 100644 --- a/modules/csync_owncloud.c +++ b/modules/csync_owncloud.c @@ -488,6 +488,9 @@ static int fetch_resource_list( const char *curi, { int ret = 0; + if (!curi) + return NE_ERROR; + /* do a propfind request and parse the results in the results function, set as callback */ ret = ne_simple_propfind( dav_session.ctx, curi, depth, ls_props, results, fetchCtx ); @@ -538,7 +541,7 @@ static csync_vio_file_stat_t *resourceToFileStat( struct resource *res ) /* cleanPath to return an escaped path of an uri */ static char *_cleanPath( const char* uri ) { int rc = 0; - char *path; + char *path = NULL; char *re = NULL; rc = c_parse_uri( uri, NULL, NULL, NULL, NULL, NULL, &path ); @@ -546,7 +549,8 @@ static char *_cleanPath( const char* uri ) { DEBUG_WEBDAV(("Unable to cleanPath %s\n", uri ? uri: "" )); re = NULL; } else { - re = ne_path_escape( path ); + if (path) + re = ne_path_escape( path ); } SAFE_FREE( path ); return re;