A heat exchanger comprising: walls (20, 30) to form a space for a flue gas, and at least one channel is formed in at least one of the walls in which a fluid is to flow, the channel includes at least two straight portions (60a, 60b) which are arranged in substantially parallel to each other and are connected in series, wherein at least one wall (20, 30) has an inside wall and an outside wall which face to each other and between which the channel is formed, and further has a wall element which connects the inside wall and the outside wall and defines the channel, and the wall element includes an extending wall element which extends along the main axis of the straight portion and extends from an inner part of a joint of the straight portions (60a, 60b) around which the fluid is to turn, characterized in that a stagnation prevention means (64, 264) is arranged in at least one connecting area of the straight portions (60a, 60b) where the two straight portions (60a, 60b) are connected and which is located on the most upstream side in the channel with respect to a fluid flow, the stagnation prevention means (64, 264) is arranged in the vicinity of the inner part of the joint of the straight portions (60a, 60b) around which the fluid is to turn, the stagnation prevention means (64, 264) includes a first portion (64a, 264a) which is arranged on the upstream side and a second portion (64b, 264b) which is arranged on the downstream side with respect to the fluid flow, and a maximum distance between the second portion (64b, 264b) and the extending wall element is shorter than a maximum distance between the first portion (64a, 264a) and the extending wall element. walls (20, 30) to form a space for a flue gas, and at least one channel is formed in at least one of the walls in which a fluid is to flow, the channel includes at least two straight portions (60a, 60b) which are arranged in substantially parallel to each other and are connected in series, wherein at least one wall (20, 30) has an inside wall and an outside wall which face to each other and between which the channel is formed, and further has a wall element which connects the inside wall and the outside wall and defines the channel, and the wall element includes an extending wall element which extends along the main axis of the straight portion and extends from an inner part of a joint of the straight portions (60a, 60b) around which the fluid is to turn, characterized in that a stagnation prevention means (64, 264) is arranged in at least one connecting area of the straight portions (60a, 60b) where the two straight portions (60a, 60b) are connected and which is located on the most upstream side in the channel with respect to a fluid flow, the stagnation prevention means (64, 264) is arranged in the vicinity of the inner part of the joint of the straight portions (60a, 60b) around which the fluid is to turn, the stagnation prevention means (64, 264) includes a first portion (64a, 264a) which is arranged on the upstream side and a second portion (64b, 264b) which is arranged on the downstream side with respect to the fluid flow, and a maximum distance between the second portion (64b, 264b) and the extending wall element is shorter than a maximum distance between the first portion (64a, 264a) and the extending wall element.