Patchwork [01/11] Properly escape QDECREF macro arguments

login
register
mail settings
Submitter Anthony Liguori
Date Nov. 11, 2009, 5:28 p.m.
Message ID <1257960543-26373-1-git-send-email-aliguori@us.ibm.com>
Download mbox | patch
Permalink /patch/38157/
State New
Headers show

Comments

Anthony Liguori - Nov. 11, 2009, 5:28 p.m.
QDECREF does not properly escape the macro arguments which can lead to
unexpected syntax errors.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
---
 qobject.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Patch

diff --git a/qobject.h b/qobject.h
index 4cc9287..76f669f 100644
--- a/qobject.h
+++ b/qobject.h
@@ -60,7 +60,7 @@  typedef struct QObject {
     QObject base
 
 /* Get the 'base' part of an object */
-#define QOBJECT(obj) (&obj->base)
+#define QOBJECT(obj) (&(obj)->base)
 
 /* High-level interface for qobject_incref() */
 #define QINCREF(obj)      \