What happens if a program is statically linked to OpenSSL 1.0.2, but dynamically linked to a library like libpq (Postgres client) and this is linked to an older OpenSSL version?
So yes, two different versions but is that automatically bad? It could be, but remember that exploits, even serious ones, are usually on very discrete vectors. It can be hard to exploit something abstracted away through two application layers.