Fix static analysis issue 93/198893/2
authorHwankyu Jhun <h.jhun@samsung.com>
Thu, 31 Jan 2019 00:47:56 +0000 (09:47 +0900)
committerHwanKyu Jhun <h.jhun@samsung.com>
Thu, 31 Jan 2019 01:04:51 +0000 (01:04 +0000)
Adds calling va_end() before returning the function.

Change-Id: I13a3ea07e38fd5b729e84355dd30e2de8c9c0caa
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
src/app_control.c

index 75da24a..27e609a 100644 (file)
@@ -336,6 +336,7 @@ int app_control_create_with_parameters(app_control_h *app_control,
                key = va_arg(vl, char *);
                ret = app_control_validate_extra_data(key);
                if (ret != APP_CONTROL_ERROR_NONE) {
+                       va_end(vl);
                        app_control_destroy(tmp_control);
                        return ret;
                }
@@ -343,12 +344,14 @@ int app_control_create_with_parameters(app_control_h *app_control,
                val = va_arg(vl, char *);
                ret = app_control_validate_extra_data(val);
                if (ret != APP_CONTROL_ERROR_NONE) {
+                       va_end(vl);
                        app_control_destroy(tmp_control);
                        return ret;
                }
 
                ret = app_control_add_extra_data(tmp_control, key, val);
                if (ret != APP_CONTROL_ERROR_NONE) {
+                       va_end(vl);
                        app_control_destroy(tmp_control);
                        return ret;
                }