diff --git a/src/_tkagg.cpp b/src/_tkagg.cpp index 47862838bbda..9c9623344b84 100644 --- a/src/_tkagg.cpp +++ b/src/_tkagg.cpp @@ -118,7 +118,7 @@ static int PyAggImagePhoto(ClientData clientdata, Tcl_Interp *interp, int try { destbuffer = new agg::int8u[deststride * destheight]; } - catch (std::bad_alloc) { + catch (const std::bad_alloc &) { TCL_APPEND_RESULT(interp, "could not allocate memory", (char *)NULL); return TCL_ERROR; }