This is what a grammar book I use (Michael Swan. Practical English usage. Third edition) says at 299.13:
To talk about fear of things that happen accidentally, we prefer afraid of + -ing.
I don't like to drive fast because I'm afraid of crashing.
Why are you so quiet? ~ I'm afraid of waking the children.
In other cases we can use afraid of + -ing or afraid + infinitive with no difference of meaning.
I'm not afraid of telling / to tell her the truth.