The Feynman rule for each of the vertices, in its usual writing, is a sum of 3 terms of the form
$$ g\,f^{abc}\,[\eta^{\mu\nu}(p-k)^{\sigma}+\cdots] $$
(hence of 6 terms in total, separately counting each momentum). In the QCD action, these 6 terms are not present: the action only actually contains one of them, which is then re-written for 6 times and symmetrized in order to account for the symmetries with respect to the color and Lorentz indices. Therefore for each of these vertices you must count in a factor of $1/6$. Since in this case you have two of them, you must multiply your diagram by a factor of $1/36$. When multiplied by the factor of 18 that you derived, you obtain $1/2$.