Package: amanda / 1:3.5.1-2

24-for-jose-server Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
Index: amanda-3.5.1~bpo9/common-src/protocol.c
===================================================================
--- amanda-3.5.1~bpo9.orig/common-src/protocol.c	2018-01-07 19:21:54.000000000 +0000
+++ amanda-3.5.1~bpo9/common-src/protocol.c	2018-02-09 21:38:56.907455585 +0000
@@ -179,8 +179,8 @@ protocol_sendreq(
     void *			datap)
 {
     proto_t *p;
-    char    *platform = NULL;
-    char    *distro = NULL;
+    static char *platform = NULL;
+    static char *distro = NULL;
 
     p = g_malloc(sizeof(proto_t));
     p->state = s_sendreq;
@@ -209,7 +209,10 @@ protocol_sendreq(
     proto_debug(1, _("protocol: security_connect: host %s -> p %p\n"),
 		    hostname, p);
 
-    get_platform_and_distro(&platform, &distro);
+    if (!platform && !distro) {
+	get_platform_and_distro(&platform, &distro);
+    }
+
     if (distro != NULL &&
 	!g_str_equal(distro, "mac") &&
 #if defined HAVE_FUNC_GETSERVBYNAME_R_4 || defined HAVE_FUNC_GETSERVBYNAME_R_5 || defined HAVE_FUNC_GETSERVBYNAME_R_6
@@ -243,8 +246,6 @@ protocol_sendreq(
 	security_connect(p->security_driver, p->hostname, p->conf_fn, connect_callbackX,
 			 p, p->datap);
     }
-    g_free(platform);
-    g_free(distro);
 }
 
 static gpointer