[1/3] alfred: Check if tg hash was really initialized

Message ID 20170601062632.4239-1-sven@narfation.org (mailing list archive)
State Accepted, archived
Commit 924ed58a1a59b287f0968006fc659a4f9fa7590b
Headers
Series [1/3] alfred: Check if tg hash was really initialized |

Commit Message

Sven Eckelmann June 1, 2017, 6:26 a.m. UTC
  The return value check after the tg_hash_new call must actually check the
return value and not some other datastructure.

Fixes: a7bc3d9a2b3f ("alfred: Cache the global translation table entries")
Signed-off-by: Sven Eckelmann <sven@narfation.org>
---
 server.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Simon Wunderlich June 1, 2017, 8:15 a.m. UTC | #1
Thanks a lot for fixing that thing I missed and the initialization problems. I 
guess this also takes of the covery splats. I've picked all patches as they 
are.

Thanks,
     Simon

On Thursday, June 1, 2017 8:26:30 AM CEST Sven Eckelmann wrote:
> The return value check after the tg_hash_new call must actually check the
> return value and not some other datastructure.
> 
> Fixes: a7bc3d9a2b3f ("alfred: Cache the global translation table entries")
> Signed-off-by: Sven Eckelmann <sven@narfation.org>
> ---
>  server.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/server.c b/server.c
> index 1e358cf..9774281 100644
> --- a/server.c
> +++ b/server.c
> @@ -232,7 +232,7 @@ static void update_server_info(struct globals *globals)
> 
>  	if (strcmp(globals->mesh_iface, "none") != 0) {
>  		tg_hash = tg_hash_new(globals->mesh_iface);
> -		if (!globals->data_hash) {
> +		if (!tg_hash) {
>  			fprintf(stderr, "Failed to create translation hash\n");
>  			return;
>  		}
  
Sven Eckelmann June 1, 2017, 8:25 a.m. UTC | #2
On Donnerstag, 1. Juni 2017 10:15:20 CEST Simon Wunderlich wrote:
> Thanks a lot for fixing that thing I missed and the initialization problems. I 
> guess this also takes of the covery splats. I've picked all patches as they 
> are.

Can you please also push patches 2 + 3.

Thanks,
	Sven
  

Patch

diff --git a/server.c b/server.c
index 1e358cf..9774281 100644
--- a/server.c
+++ b/server.c
@@ -232,7 +232,7 @@  static void update_server_info(struct globals *globals)
 
 	if (strcmp(globals->mesh_iface, "none") != 0) {
 		tg_hash = tg_hash_new(globals->mesh_iface);
-		if (!globals->data_hash) {
+		if (!tg_hash) {
 			fprintf(stderr, "Failed to create translation hash\n");
 			return;
 		}