Catalyzes the reversible oxidation of malate to oxaloacetate. Can use NAD(+) and NADP(+) with similar specific activity. (S)-malate + NADP(+) = H(+) + NADPH + oxaloacetate (S)-malate + NAD(+) = H(+) + NADH + oxaloacetate Belongs to the LDH/MDH superfamily.