diff mbox series

suricatta: Fix CID 292131 constant dead code guard

Message ID 20200409180852.456-1-toertel@gmail.com
State Accepted
Headers show
Series suricatta: Fix CID 292131 constant dead code guard | expand

Commit Message

Mark Jonas April 9, 2020, 6:08 p.m. UTC
'filename' is once assigned to NULL and never used.

Signed-off-by: Mark Jonas <toertel@gmail.com>
---
 suricatta/server_hawkbit.c | 4 ----
 1 file changed, 4 deletions(-)

Comments

Stefano Babic April 9, 2020, 7 p.m. UTC | #1
On 09/04/20 20:08, Mark Jonas wrote:
> 'filename' is once assigned to NULL and never used.
> 
> Signed-off-by: Mark Jonas <toertel@gmail.com>
> ---
>  suricatta/server_hawkbit.c | 4 ----
>  1 file changed, 4 deletions(-)
> 
> diff --git a/suricatta/server_hawkbit.c b/suricatta/server_hawkbit.c
> index 0b0e00b..3509006 100644
> --- a/suricatta/server_hawkbit.c
> +++ b/suricatta/server_hawkbit.c
> @@ -1110,7 +1110,6 @@ server_op_res_t server_process_update_artifact(int action_id,
>  		      json_object_get_string(json_data_artifact_filename),
>  		      json_object_get_string(json_data_artifact_url));
>  
> -		char *filename = NULL;
>  		channel_data_t channel_data = channel_data_defaults;
>  		channel_data.url =
>  		    strdup(json_object_get_string(json_data_artifact_url));
> @@ -1218,9 +1217,6 @@ server_op_res_t server_process_update_artifact(int action_id,
>  		if (channel_data.url != NULL) {
>  			free(channel_data.url);
>  		}
> -		if (filename != NULL) {
> -			free(filename);
> -		}
>  		if (channel_data.info != NULL) {
>  			free(channel_data.info);
>  		}
> 
Acked-by: Stefano Babic  <sbabic@denx.de>

Best regards,
Stefano Babic
diff mbox series

Patch

diff --git a/suricatta/server_hawkbit.c b/suricatta/server_hawkbit.c
index 0b0e00b..3509006 100644
--- a/suricatta/server_hawkbit.c
+++ b/suricatta/server_hawkbit.c
@@ -1110,7 +1110,6 @@  server_op_res_t server_process_update_artifact(int action_id,
 		      json_object_get_string(json_data_artifact_filename),
 		      json_object_get_string(json_data_artifact_url));
 
-		char *filename = NULL;
 		channel_data_t channel_data = channel_data_defaults;
 		channel_data.url =
 		    strdup(json_object_get_string(json_data_artifact_url));
@@ -1218,9 +1217,6 @@  server_op_res_t server_process_update_artifact(int action_id,
 		if (channel_data.url != NULL) {
 			free(channel_data.url);
 		}
-		if (filename != NULL) {
-			free(filename);
-		}
 		if (channel_data.info != NULL) {
 			free(channel_data.info);
 		}