leoalekseyev/xournal — pull request #1 by x2b (2012-03-08 19:47:02+00:00)
Title: 2 small fixes

Hello Leo,

I read your announcement on xournal-devel and I much appreciate the work that you have done to include the various patches. However, your version of xournal did neither compile nor run under my linux without problems:

Firstly I found out that using my up-to-date arch linux ( "$host" = i686-pc-linux-gnu ) I require some additional libraries without which the code won't compile. I added them in [this commit](https://github.com/x2b/xournal/commit/c36b975fe1ddb018cf8c4f48bbd90b998cbd33f6). If you don't need them with your distribution you could also add them to the case distinction in configure.in instead.

Additionally there is a problem that causes xournal to crash whenever an image is added: [In this line of code](https://github.com/x2b/xournal/blob/master/src/xo-image.c#L78) you call g_free on an uninitialized pointer:
When you create the Item [here](https://github.com/x2b/xournal/blob/master/src/xo-image.c#L252), the image_path member is not in any way treated, that is the pointer contains random data causing xournal to crash once g_free is called. I [set](https://github.com/x2b/xournal/commit/65f858aac95b4b0bd04751db2f771c7d7200a34d) the pointer to `NULL`, which gets rid of the error.

Please include these fixes in your revision.

x2b