]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
uml: Resolve leak if need to requery in umlIdentifyOneChrPTY()
authorJohn Ferlan <jferlan@redhat.com>
Wed, 30 Jan 2013 14:54:41 +0000 (09:54 -0500)
committerJohn Ferlan <jferlan@redhat.com>
Tue, 5 Feb 2013 21:51:07 +0000 (16:51 -0500)
Coverity noted that in the retry logic loop if res had been set, then
it could be leaked so add a VIR_FREE(res) prior to retry.

src/uml/uml_driver.c

index f2cdc8d8e002e0621a44420dc706ba97e8718f1d..3f245b6bdfc42d5d28f636e5237a8b2cbd3a38bd 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * uml_driver.c: core driver methods for managing UML guests
  *
- * Copyright (C) 2006-2012 Red Hat, Inc.
+ * Copyright (C) 2006-2013 Red Hat, Inc.
  * Copyright (C) 2006-2008 Daniel P. Berrange
  *
  * This library is free software; you can redistribute it and/or
@@ -261,6 +261,7 @@ requery:
         /* XXX should do this in a better non-blocking
            way somehow ...perhaps register a timer */
         if (retries++ < 50) {
+            VIR_FREE(res);
             usleep(1000*10);
             goto requery;
         }