summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordiscomfitor <michael.blumenkrantz@gmail.com>2013-09-08 19:12:18 +0100
committerdiscomfitor <michael.blumenkrantz@gmail.com>2013-09-08 19:12:18 +0100
commit534e48578996e3c4d267cd61baddc9d03bcb40af (patch)
tree2e1c701f243e90977dad4944619e51e7045d2c98
parent5eda1a5383a4134fd843debee4ee3d278575965b (diff)
don't leak passwords...
-rw-r--r--src/modules/virt.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/modules/virt.c b/src/modules/virt.c
index 9318c38..5408423 100644
--- a/src/modules/virt.c
+++ b/src/modules/virt.c
@@ -179,7 +179,7 @@ virt_timer_add(int interval, virEventTimeoutCallback cb, void *opaque, virFreeCa
179} 179}
180 180
181static Virt_Domain * 181static Virt_Domain *
182virt_domain_add(const char *uuid, const char *name, Eina_Stringshare *uri, const char *addr, int port, int tls_port, const char *password) 182virt_domain_add(const char *uuid, const char *name, Eina_Stringshare *uri, const char *addr, int port, int tls_port, char *password)
183{ 183{
184 Virt_Domain *vd; 184 Virt_Domain *vd;
185 185
@@ -191,8 +191,8 @@ virt_domain_add(const char *uuid, const char *name, Eina_Stringshare *uri, const
191 vd->addr = addr; 191 vd->addr = addr;
192 vd->port = port; 192 vd->port = port;
193 vd->tls_port = tls_port; 193 vd->tls_port = tls_port;
194 if (password) 194 /* this is also already allocated */
195 vd->password = strdup(password); 195 vd->password = password;
196 return vd; 196 return vd;
197} 197}
198 198
@@ -249,8 +249,7 @@ virt_display_handle(virDomainPtr dom)
249 E_FREE(vd->password); 249 E_FREE(vd->password);
250 vd->port = port; 250 vd->port = port;
251 vd->tls_port = tls_port; 251 vd->tls_port = tls_port;
252 if (passwd) 252 vd->password = passwd;
253 vd->password = strdup(passwd);
254 } 253 }
255 else 254 else
256 { 255 {