There's really no need to make an unsafe temporary allocation for a simple type like Int. You can just assign it a value, and if you only need it once, just pass it through with &. For example:
var size = buf_size
c_birthday(rawPtr.baseAddress, data_len, res_ptr.baseAddress, &size)
In this case, since you know your size is fixed, and it's actually quite large (1 MB) it is never going to fit on the stack anyways. So there is no need to use a function that will try to do that: just use Array's init(unsafeUninitializedCapacity:initializingWith:) initializer instead, and you will bridge it into Swift's lifetime management without having to do the whole closure dance. Finally, since your API is unlikely to modify the buffer you pass it in, try using withUnsafeBytes instead of withUnsafeMutableBytes (and correctly annotating the pointer with const in your bridge).