It was a good call.
The bad calls is when they let the offensive player get away with the kick.
I'm not down with blatant leg kicks, but this didn't seem that way to me. I mean, if a guy is going hard in one direction, tries to stabilize for a quick catch and shoot, he may still have a bit of residual momentum that, after briefly stabilizing for the shot, propels him in his original direction, in which case a bit of a leg flail would be completely natural.
Besides, since he got the shot off before the alleged foul, shouldn't the shot still count? Kind of like when a guy makes a shot but his teammate under the hoop commits a foul while positioning for the rebound, but the shot still counts.