owncloud: Fix possible NULL pointer dereferences.

CID: #996808

Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
Klaas Freitag 2013-07-10 15:17:26 +02:00 committed by Andreas Schneider
parent 722a556a90
commit 40d1498fc3

View file

@ -1384,14 +1384,12 @@ static csync_vio_file_stat_t *owncloud_readdir(csync_vio_method_handle_t *dhandl
struct listdir_context *fetchCtx = dhandle; struct listdir_context *fetchCtx = dhandle;
csync_vio_file_stat_t *lfs = NULL; csync_vio_file_stat_t *lfs = NULL;
if( fetchCtx->currResource ) { if( fetchCtx == NULL) {
// DEBUG_WEBDAV("readdir method called for %s, fetchCtx->currResource->uri);
} else {
/* DEBUG_WEBDAV("An empty dir or at end); */ /* DEBUG_WEBDAV("An empty dir or at end); */
return NULL; return NULL;
} }
if( fetchCtx && fetchCtx->currResource ) { if( fetchCtx->currResource ) {
/* FIXME: Who frees the allocated mem for lfs, allocated in the helper func? */ /* FIXME: Who frees the allocated mem for lfs, allocated in the helper func? */
lfs = resourceToFileStat( fetchCtx->currResource ); lfs = resourceToFileStat( fetchCtx->currResource );