summaryrefslogtreecommitdiffstats
path: root/src/ui/clipboard.cpp
diff options
context:
space:
mode:
authorKris De Gussem <kris.degussem@gmail.com>2012-02-21 19:51:35 +0000
committerKris <Kris.De.Gussem@hotmail.com>2012-02-21 19:51:35 +0000
commit354e3b4f0fd6fcca9995d611b6f031dfa9068ee7 (patch)
tree6bd095dbd0218b72f29147a6ede741092565dda9 /src/ui/clipboard.cpp
parentFix for 934721 : Convert SpellCheck dialog to a dockable dialog (diff)
downloadinkscape-354e3b4f0fd6fcca9995d611b6f031dfa9068ee7.tar.gz
inkscape-354e3b4f0fd6fcca9995d611b6f031dfa9068ee7.zip
cppcheck: null pointer dereference fix
(bzr r11007)
Diffstat (limited to 'src/ui/clipboard.cpp')
-rw-r--r--src/ui/clipboard.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/ui/clipboard.cpp b/src/ui/clipboard.cpp
index 65141ca10..534f57a57 100644
--- a/src/ui/clipboard.cpp
+++ b/src/ui/clipboard.cpp
@@ -1479,11 +1479,11 @@ void ClipboardManagerImpl::_userWarn(SPDesktop *desktop, char const *msg)
void ClipboardManagerImpl::_inkscape_wait_for_targets(std::list<Glib::ustring> &listTargets)
{
//Get a newly-allocated array of atoms:
- GdkAtom* targets = 0;
+ GdkAtom* targets = NULL;
gint n_targets = 0;
gboolean test = gtk_clipboard_wait_for_targets( gtk_clipboard_get(GDK_SELECTION_CLIPBOARD), &targets, &n_targets );
- if (!test) {
- n_targets = 0; //otherwise it will be -1.
+ if (!test || (targets == NULL)) {
+ return;
}
//Add the targets to the C++ container: