The onset of a double-diffusive convective regime in a rectangular cavity filled with a porous medium saturated by a binary fluid is studied. The two vertical walls are kept at different but uniform temperatures and concentrations, while the horizontal walls are impermeable and adiabatic. When the ratio of the resulting solutal and thermal buoyancy forces is equal to (-1), an equilibrium solution corresponding to a purely diffusive regime is obtained. We demonstrate that this regime is linearly stable until a critical thermal Rayleigh number, Ra-c, depending on the cell aspect ratio, A, and the Lewis number, Le. For a square cavity we obtained Ra-c \Le - 1\ = 184.06, and for an infinite vertical layer the critical parameters are found to follow Ra-c\Le - 1\ = 105.33 and k(c) = 2.51. These analytical results are in good agreement with numerical direct simulations. It is thus found that the bifurcation that corresponds to the onset of convection is a transcritical type for A = 1. The structures of the subcritical and supercritical steady solutions, at several values of the Lewis number and for a square cavity, have been studied numerically. The double-diffusive convective regime taking place when the equilibrium regime loses its stability is also described.