Changeset 2489

Show
Ignore:
Timestamp:
08/24/07 18:51:26 (1 year ago)
Author:
dgollub
Message:

Fixed leaking convert path object. Handle the error condition if now
converter path was found.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • plugins/file-sync/src/file_sync.c

    r2487 r2489  
    340340                        if (dir->objformat && strcmp("file", dir->objformat)) { 
    341341 
     342                                osync_bool ret; 
    342343                                OSyncFormatConverterPath *path = NULL; 
    343344 
     
    366367                                path = osync_format_env_find_path(formatenv, detectedFormat, targetformat, &error); 
    367368 
    368                                 if (!osync_format_env_convert(formatenv, path, odata, &error)) { 
     369                                if (!path) 
     370                                        goto error; 
     371 
     372                                ret = osync_format_env_convert(formatenv, path, odata, &error); 
     373                                osync_converter_path_unref(path); 
     374 
     375                                if (!ret) { 
    369376                                        osync_error_set(&error, OSYNC_ERROR_EXISTS, "Can't convert to customized objformat."); 
    370377                                        goto error; 
     
    375382                                path = osync_format_env_find_path(formatenv, targetformat, fileformat, &error); 
    376383 
    377                                 if (!osync_format_env_convert(formatenv, path, odata, &error)) { 
     384                                if (!path) 
     385                                        goto error; 
     386 
     387                                ret = osync_format_env_convert(formatenv, path, odata, &error); 
     388                                osync_converter_path_unref(path); 
     389 
     390                                if (!ret) { 
    378391                                        osync_error_set(&error, OSYNC_ERROR_EXISTS, "Can't convert to customized objformat."); 
    379392                                        goto error; 
    380393                                } 
     394 
    381395 
    382396                        }