summaryrefslogtreecommitdiff
path: root/app_control/app_control.c
diff options
context:
space:
mode:
Diffstat (limited to 'app_control/app_control.c')
-rwxr-xr-xapp_control/app_control.c65
1 files changed, 35 insertions, 30 deletions
diff --git a/app_control/app_control.c b/app_control/app_control.c
index d2ad6a0..55eda27 100755
--- a/app_control/app_control.c
+++ b/app_control/app_control.c
@@ -342,12 +342,13 @@ int app_control_get_operation(app_control_h app_control, char **operation)
return app_control_error(APP_CONTROL_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL);
operation_value = aul_svc_get_operation(app_control->data);
- if (operation_value == NULL)
- return app_control_error(APP_CONTROL_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL);
-
- *operation = strdup(operation_value);
- if (*operation == NULL)
- return app_control_error(APP_CONTROL_ERROR_OUT_OF_MEMORY, __FUNCTION__, NULL);
+ if (operation_value) {
+ *operation = strdup(operation_value);
+ if (*operation == NULL)
+ return app_control_error(APP_CONTROL_ERROR_OUT_OF_MEMORY, __FUNCTION__, NULL);
+ } else {
+ *operation = NULL;
+ }
return APP_CONTROL_ERROR_NONE;
}
@@ -375,12 +376,13 @@ int app_control_get_uri(app_control_h app_control, char **uri)
return app_control_error(APP_CONTROL_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL);
uri_value = aul_svc_get_uri(app_control->data);
- if (uri_value == NULL)
- return app_control_error(APP_CONTROL_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL);
-
- *uri = strdup(uri_value);
- if (*uri == NULL)
- return app_control_error(APP_CONTROL_ERROR_OUT_OF_MEMORY, __FUNCTION__, NULL);
+ if (uri_value) {
+ *uri = strdup(uri_value);
+ if (*uri == NULL)
+ return app_control_error(APP_CONTROL_ERROR_OUT_OF_MEMORY, __FUNCTION__, NULL);
+ } else {
+ *uri = NULL;
+ }
return APP_CONTROL_ERROR_NONE;
}
@@ -408,12 +410,13 @@ int app_control_get_mime(app_control_h app_control, char **mime)
return app_control_error(APP_CONTROL_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL);
mime_value = aul_svc_get_mime(app_control->data);
- if (mime_value == NULL)
- return app_control_error(APP_CONTROL_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL);
-
- *mime = strdup(mime_value);
- if (*mime == NULL)
- return app_control_error(APP_CONTROL_ERROR_OUT_OF_MEMORY, __FUNCTION__, NULL);
+ if (mime_value) {
+ *mime = strdup(mime_value);
+ if (*mime == NULL)
+ return app_control_error(APP_CONTROL_ERROR_OUT_OF_MEMORY, __FUNCTION__, NULL);
+ } else {
+ *mime = NULL;
+ }
return APP_CONTROL_ERROR_NONE;
}
@@ -441,12 +444,13 @@ int app_control_get_category(app_control_h app_control, char **category)
return app_control_error(APP_CONTROL_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL);
category_value = aul_svc_get_category(app_control->data);
- if (category_value == NULL)
- return app_control_error(APP_CONTROL_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL);
-
- *category = strdup(category_value);
- if (*category == NULL)
- return app_control_error(APP_CONTROL_ERROR_OUT_OF_MEMORY, __FUNCTION__, NULL);
+ if (category_value) {
+ *category = strdup(category_value);
+ if (*category == NULL)
+ return app_control_error(APP_CONTROL_ERROR_OUT_OF_MEMORY, __FUNCTION__, NULL);
+ } else {
+ *category = NULL;
+ }
return APP_CONTROL_ERROR_NONE;
}
@@ -486,12 +490,13 @@ int app_control_get_app_id(app_control_h app_control, char **app_id)
return app_control_error(APP_CONTROL_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL);
app_id_value = aul_svc_get_appid(app_control->data);
- if (app_id_value == NULL)
- return app_control_error(APP_CONTROL_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL);
-
- *app_id = strdup(app_id_value);
- if (*app_id == NULL)
- return app_control_error(APP_CONTROL_ERROR_OUT_OF_MEMORY, __FUNCTION__, NULL);
+ if (app_id_value) {
+ *app_id = strdup(app_id_value);
+ if (*app_id == NULL)
+ return app_control_error(APP_CONTROL_ERROR_OUT_OF_MEMORY, __FUNCTION__, NULL);
+ } else {
+ *app_id = NULL;
+ }
return APP_CONTROL_ERROR_NONE;
}