Question:
Is it permitted for an onen (a mourner before burial) to give tzedakah before the burial?
Answer:
Yes, he may do so, especially if it is done for the aliyat neshama (elevation of the soul) of the deceased.
Reasoning:
Even aside from the fact that the mitzvah of tzedakah includes a negative commandment—one which an onen is still obligated to observe, not only a positive commandment—there is additional basis for leniency. One can argue, as Rav Elyashiv suggests, that the restriction preventing an onen from performing positive commandments applies specifically to mitzvot between אדם למקום (between a person and God), but not to mitzvot between אדם לחבירו (between a person and another individual), which are acts of kindness (chessed).
Accordingly, we do not find any source that prohibits an onen from continuing to host guests or assist others prior to the burial. Furthermore, when tzedakah is given for the sake of the aliyat neshama, it is comparable to reciting Kaddish on behalf of the deceased—something we are careful to do even before the burial.
Sources:
See Rav Elyashiv in Ashrei Ish 45:28; Minchas Shlomo 1:91-28-4; Yalkut Yosef Avvelus 7:53; Avelus Vitameha p. 78; Kovetz Shiurim Bava Basra 48