Browse code

- fixup for adding LUMP_RPL_BODY (testing for multiple lumps)

Bogdan-Andrei Iancu authored on 09/12/2003 13:59:00
Showing 1 changed files
... ...
@@ -81,13 +81,16 @@ struct lump_rpl* add_lump_rpl(struct sip_msg *msg, char *s, int len, int flags)
81 81
 		if (!(flags&LUMP_RPL_BODY))
82 82
 			for(foo=msg->reply_lump;foo->next;foo=foo->next);
83 83
 		else
84
-			for(foo=msg->reply_lump;foo->next;foo=foo->next)
85
-				if (lump->flags&LUMP_RPL_BODY) {
84
+			for(foo=msg->reply_lump; ;foo=foo->next) {
85
+				if (foo->flags&LUMP_RPL_BODY) {
86 86
 					LOG(L_ERR,"ERROR:add_lump_rpl: LUMP_RPL_BODY "
87 87
 						"already added!\n");
88 88
 					pkg_free(lump);
89 89
 					goto error;
90 90
 				}
91
+				if (foo->next==0)
92
+					break;
93
+			}
91 94
 		foo->next = lump;
92 95
 	}
93 96