Use error label instead of err or err_out

This commit is contained in:
Marcel Holtmann 2009-12-24 07:09:09 -08:00
parent 2876e1aa64
commit 0b359e89db
3 changed files with 23 additions and 23 deletions

View File

@ -1755,61 +1755,61 @@ static gboolean load_context(struct ofono_gprs *gprs, const char *group)
if ((name = g_key_file_get_string(gprs->settings, group, if ((name = g_key_file_get_string(gprs->settings, group,
"Name", NULL)) == NULL) "Name", NULL)) == NULL)
goto err; goto error;
if ((typestr = g_key_file_get_string(gprs->settings, group, if ((typestr = g_key_file_get_string(gprs->settings, group,
"Type", NULL)) == NULL) "Type", NULL)) == NULL)
goto err; goto error;
type = gprs_context_string_to_type(typestr); type = gprs_context_string_to_type(typestr);
if (type == GPRS_CONTEXT_TYPE_INVALID) if (type == GPRS_CONTEXT_TYPE_INVALID)
goto err; goto error;
username = g_key_file_get_string(gprs->settings, group, username = g_key_file_get_string(gprs->settings, group,
"Username", NULL); "Username", NULL);
if (!username) if (!username)
goto err; goto error;
if (strlen(username) > OFONO_GPRS_MAX_USERNAME_LENGTH) if (strlen(username) > OFONO_GPRS_MAX_USERNAME_LENGTH)
goto err; goto error;
password = g_key_file_get_string(gprs->settings, group, password = g_key_file_get_string(gprs->settings, group,
"Password", NULL); "Password", NULL);
if (!password) if (!password)
goto err; goto error;
if (strlen(password) > OFONO_GPRS_MAX_PASSWORD_LENGTH) if (strlen(password) > OFONO_GPRS_MAX_PASSWORD_LENGTH)
goto err; goto error;
apn = g_key_file_get_string(gprs->settings, group, apn = g_key_file_get_string(gprs->settings, group,
"AccessPointName", NULL); "AccessPointName", NULL);
if (!apn) if (!apn)
goto err; goto error;
if (strlen(apn) > OFONO_GPRS_MAX_APN_LENGTH) if (strlen(apn) > OFONO_GPRS_MAX_APN_LENGTH)
goto err; goto error;
/* Accept empty (just created) APNs, but don't allow other /* Accept empty (just created) APNs, but don't allow other
* invalid ones */ * invalid ones */
if (apn[0] != '\0' && is_valid_apn(apn) == FALSE) if (apn[0] != '\0' && is_valid_apn(apn) == FALSE)
goto err; goto error;
if ((context = pri_context_create(gprs, name, type)) == NULL) if ((context = pri_context_create(gprs, name, type)) == NULL)
goto err; goto error;
strcpy(context->context.username, username); strcpy(context->context.username, username);
strcpy(context->context.password, password); strcpy(context->context.password, password);
strcpy(context->context.apn, apn); strcpy(context->context.apn, apn);
if (context_dbus_register(context) == FALSE) if (context_dbus_register(context) == FALSE)
goto err; goto error;
gprs->contexts = g_slist_append(gprs->contexts, context); gprs->contexts = g_slist_append(gprs->contexts, context);
ret = TRUE; ret = TRUE;
err: error:
g_free(name); g_free(name);
g_free(typestr); g_free(typestr);
g_free(username); g_free(username);

View File

@ -555,7 +555,7 @@ char *convert_gsm_to_utf8_with_lang(const unsigned char *text, long len,
return NULL; return NULL;
if (len < 0 && !terminator) if (len < 0 && !terminator)
goto err_out; goto error;
if (len < 0) { if (len < 0) {
i = 0; i = 0;
@ -570,17 +570,17 @@ char *convert_gsm_to_utf8_with_lang(const unsigned char *text, long len,
unsigned short c; unsigned short c;
if (text[i] > 0x7f) if (text[i] > 0x7f)
goto err_out; goto error;
if (text[i] == 0x1b) { if (text[i] == 0x1b) {
++i; ++i;
if (i >= len) if (i >= len)
goto err_out; goto error;
c = gsm_single_shift_lookup(text[i], single_lang); c = gsm_single_shift_lookup(text[i], single_lang);
if (c == GUND) if (c == GUND)
goto err_out; goto error;
} else { } else {
c = gsm_locking_shift_lookup(text[i], locking_lang); c = gsm_locking_shift_lookup(text[i], locking_lang);
} }
@ -591,7 +591,7 @@ char *convert_gsm_to_utf8_with_lang(const unsigned char *text, long len,
res = g_malloc(res_length + 1); res = g_malloc(res_length + 1);
if (!res) if (!res)
goto err_out; goto error;
out = res; out = res;
@ -614,7 +614,7 @@ char *convert_gsm_to_utf8_with_lang(const unsigned char *text, long len,
if (items_written) if (items_written)
*items_written = out - res; *items_written = out - res;
err_out: error:
if (items_read) if (items_read)
*items_read = i; *items_read = i;

View File

@ -1550,21 +1550,21 @@ void ofono_voicecall_notify(struct ofono_voicecall *vc,
if (!newcall) { if (!newcall) {
ofono_error("Unable to allocate call"); ofono_error("Unable to allocate call");
goto err; goto error;
} }
v = voicecall_create(vc, newcall); v = voicecall_create(vc, newcall);
if (!v) { if (!v) {
ofono_error("Unable to allocate voicecall_data"); ofono_error("Unable to allocate voicecall_data");
goto err; goto error;
} }
v->detect_time = time(NULL); v->detect_time = time(NULL);
if (!voicecall_dbus_register(v)) { if (!voicecall_dbus_register(v)) {
ofono_error("Unable to register voice call"); ofono_error("Unable to register voice call");
goto err; goto error;
} }
vc->call_list = g_slist_insert_sorted(vc->call_list, v, call_compare); vc->call_list = g_slist_insert_sorted(vc->call_list, v, call_compare);
@ -1573,7 +1573,7 @@ void ofono_voicecall_notify(struct ofono_voicecall *vc,
return; return;
err: error:
if (newcall) if (newcall)
g_free(newcall); g_free(newcall);