c
if (!port) {
    goto err;
} else {
    parport_put(port); // Deallocate port memory
    port = NULL;
}
err:
    // Rest of the error handling code
