When Murray comes off LTIR and Woll returns to the Marlies, the Leafs will have enough cap space to sign Knies and have a 24 man roster: 14 forwards, 8 defensemen and 2 goalies. The 23 man roster limit does not apply after the trade deadline, but the cap limit stays in effect until the start of the playoffs.
EDIT: Sorry, but my calculations were wrong. Capfriendly was showing the Leafs with over $5 million in available space after the trade, but have now revised it to $2,770,833. I believe the smaller figure is correct, which means the Leafs do not have the cap space to take Murray off LTIR without a trade.