User yourgimptutor has a nice tutorial on how to remove lens barrel distortion using GIMP. The steps boil down to:

  1. Use the filter “Lens Distortion”: Filters -> Distorts -> Lens Distortion
    For a wide angled photo with the Canon EF-S 17-55 mm lens at 21.0 mm on a 50D body (1.6 crop) I found that adjusting the “Main” slider to +20 gave a good result.

  2. Use the Perspective Transform: Tools -> Transformation Tools -> Perspective
    The edges of the image can now be dragged out to the corners to fill the canvas size.