]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
list: fix double avaluation in LIST_APPEND()
authorLennart Poettering <lennart@poettering.net>
Wed, 17 Oct 2018 19:05:33 +0000 (21:05 +0200)
committerLennart Poettering <lennart@poettering.net>
Wed, 17 Oct 2018 19:13:02 +0000 (21:13 +0200)
src/basic/list.h

index 643e0bea8887dffe74dce0e0fce596f00a48b40b..040680c30ad907250d259f6a3ae0f148b3892e2f 100644 (file)
@@ -38,9 +38,9 @@
 /* Append an item to the list */
 #define LIST_APPEND(name,head,item)                                     \
         do {                                                            \
-                typeof(*(head)) *_tail;                                 \
-                LIST_FIND_TAIL(name,head,_tail);                        \
-                LIST_INSERT_AFTER(name,head,_tail,item);                \
+                typeof(*(head)) **_hhead = &(head), *_tail;             \
+                LIST_FIND_TAIL(name, *_hhead, _tail);                   \
+                LIST_INSERT_AFTER(name, *_hhead, _tail, item);          \
         } while (false)
 
 /* Remove an item from the list */