diff options
author | Josh Triplett <josh@freedesktop.org> | 2006-04-28 12:40:09 -0700 |
---|---|---|
committer | Josh Triplett <josh@freedesktop.org> | 2006-04-28 12:40:09 -0700 |
commit | 2f68e13812a5bd9e178b2241ae0e9e8e0eb29e21 (patch) | |
tree | 5a2b89f66d5bc42b720a559d693eade7ab66e5c2 | |
parent | f06e6e5cc0576e4ad80dc307c0bec38e19c4ea87 (diff) |
Fix memory leak and warning regarding adaptors_rep. Return 0 from main for successful completion, not 1.
-rw-r--r-- | xcbxvinfo.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/xcbxvinfo.c b/xcbxvinfo.c index 3285cea..f2341e4 100644 --- a/xcbxvinfo.c +++ b/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; } |