From: <svn...@op...> - 2010-11-15 19:23:46
|
Author: scriptor Date: Mon Nov 15 20:23:35 2010 New Revision: 6161 URL: http://www.opensync.org/changeset/6161 Log: Fixed one of those "Could be used uninitialized"-bugs. Modified: plugins/ldap-sync/misc/ldap_format_convert.c plugins/ldap-sync/tests/check_do_convert_from_to.c Modified: plugins/ldap-sync/misc/ldap_format_convert.c ============================================================================== --- plugins/ldap-sync/misc/ldap_format_convert.c Mon Nov 15 20:23:27 2010 (r6160) +++ plugins/ldap-sync/misc/ldap_format_convert.c Mon Nov 15 20:23:35 2010 (r6161) @@ -941,6 +941,7 @@ OSyncFormatEnv *format_env = NULL; OSyncObjFormat *sourceformat = NULL; conv_detection detection_type = TARGET_AUTO; + const char *sourceformat_name = NULL; char *program = NULL; char *format_config = NULL; char *input_filename = NULL; @@ -1148,17 +1149,14 @@ goto error; } - - - if (sourceformat == NULL) { - osync_error_set(&error, OSYNC_ERROR_GENERIC, "%s:%i: ERROR: sourceformat = NULL. Source format could not be recognized.", __FILE__, __LINE__); + + sourceformat_name = osync_objformat_get_name(sourceformat); + if (sourceformat_name == NULL) { + osync_error_set(&error, OSYNC_ERROR_GENERIC, "%s:%i: ERROR: sourceformat_name = NULL. Source format could not be recognized.", __FILE__, __LINE__); goto error; } - char *sourceformat_name = (char *)osync_objformat_get_name(sourceformat); - - // Tell the data object what kind of source format we have just found. osync_data_set_objformat(data, sourceformat); if (osync_error_is_set(&error)) { Modified: plugins/ldap-sync/tests/check_do_convert_from_to.c ============================================================================== --- plugins/ldap-sync/tests/check_do_convert_from_to.c Mon Nov 15 20:23:27 2010 (r6160) +++ plugins/ldap-sync/tests/check_do_convert_from_to.c Mon Nov 15 20:23:35 2010 (r6161) @@ -941,6 +941,7 @@ OSyncFormatEnv *format_env = NULL; OSyncObjFormat *sourceformat = NULL; conv_detection detection_type = TARGET_AUTO; + const char *sourceformat_name = NULL; char *program = NULL; char *format_config = NULL; char *input_filename = NULL; @@ -1148,17 +1149,14 @@ goto error; } - - - if (sourceformat == NULL) { - osync_error_set(&error, OSYNC_ERROR_GENERIC, "%s:%i: ERROR: sourceformat = NULL. Source format could not be recognized.", __FILE__, __LINE__); + + sourceformat_name = osync_objformat_get_name(sourceformat); + if (sourceformat_name == NULL) { + osync_error_set(&error, OSYNC_ERROR_GENERIC, "%s:%i: ERROR: sourceformat_name = NULL. Source format could not be recognized.", __FILE__, __LINE__); goto error; } - char *sourceformat_name = (char *)osync_objformat_get_name(sourceformat); - - // Tell the data object what kind of source format we have just found. osync_data_set_objformat(data, sourceformat); if (osync_error_is_set(&error)) { |