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

View File

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

View File

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