[Xcb-commit] xcb-demo

Josh Triplett josh at kemper.freedesktop.org
Fri Apr 28 12:40:12 PDT 2006


 xcb-demo/xcbxvinfo.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

New commits:
diff-tree 58315b8478a5f9170146e71368e8d5bc872f4641 (from 10922df70a8274d0c4ffd13ebcabb2c105408961)
Author: Josh Triplett <josh at freedesktop.org>
Date:   Fri Apr 28 12:40:09 2006 -0700

    Fix memory leak and warning regarding adaptors_rep.  Return 0 from main for successful completion, not 1.

diff --git a/xcb-demo/xcbxvinfo.c b/xcb-demo/xcbxvinfo.c
index 3285cea..f2341e4 100644
--- a/xcb-demo/xcbxvinfo.c
+++ b/xcb-demo/xcbxvinfo.c
@@ -102,6 +102,7 @@ int main(int argc, char *argv[])
         adaptors_rep = XCBXvQueryAdaptorsReply(c, XCBXvQueryAdaptors(c, root_window), NULL);
         if (!adaptors_rep->num_adaptors) {
             fprintf(stdout, " no adaptors present.\n");
+            free(adaptors_rep);
             continue;
         }
 
@@ -338,10 +339,8 @@ int main(int argc, char *argv[])
             free(qencodings_rep);
             XCBXvAdaptorInfoNext(&adaptors_iter);
         }
+        free(adaptors_rep);
     }
 
-    free(adaptors_rep);
-    adaptors_rep = NULL;
-
-    return 1;
+    return 0;
 }


More information about the xcb-commit mailing list